From nginx-forum at nginx.us Sun May 1 05:04:21 2011 From: nginx-forum at nginx.us (inspire22) Date: Sat, 30 Apr 2011 21:04:21 -0400 Subject: variables in if regexes Message-ID: <96751c7eeff6de7ab97f1c1904c619bb.NginxMailingListEnglish@forum.nginx.org> I have a caching system I need to bypass if the logging in user's name is found in the $request_uri. I'm trying to do something like this, but can't get the variable to interpolate into the regex. Any suggestions pretty please? set $me "Asabouros."; if ($uri ~ $me) { set $chk ""; } I've always tried things like this: if ($uri ~ "by-{$me}") { set $chk ""; } Thanks! -Kevin Posted at Nginx Forum: http://forum.nginx.org/read.php?2,194753,194753#msg-194753 From wendal1985 at gmail.com Sun May 1 05:28:16 2011 From: wendal1985 at gmail.com (Wendal Chen) Date: Sun, 1 May 2011 09:28:16 +0800 Subject: nginx and google In-Reply-To: <4daa0cf8766acfaaccec44582e1d2037.NginxMailingListEnglish@forum.nginx.org> References: <4daa0cf8766acfaaccec44582e1d2037.NginxMailingListEnglish@forum.nginx.org> Message-ID: check your robot.txt 2011/4/30 konelli > freebsd 8 nginx-0.8.54 proxy works perfect. Any site loads very fast > thru proxy pass but google do not wont to load! Any other indexing > sites. Help. > Here my config > > worker_processes 1; > events { > worker_connections 5; > } > > http { > server { > listen 8081; > # access_log off; > > location / { > proxy_pass http://211.141.153.146; > proxy_set_header Host $host; > } > } > } > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,194580,194580#msg-194580 > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -- Wendal Chen -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Mon May 2 04:26:31 2011 From: nginx-forum at nginx.us (Andy) Date: Sun, 01 May 2011 20:26:31 -0400 Subject: Does Nginx block on file IO? Message-ID: Hi. I was always under the impression that Nginx is non-blocking for file IO. Then I was told it wasn't. I'm considering using Nginx to serve static images. Pretty much every connection will result in a file IO. If Nginx blocks for file IO, then using Nginx here wouldn't be any better than using Apache, right? Every connection will lead to a file IO which blocks the entire Nginx process. So to serve 500 concurrent connections I'll need 500 Nginx processes. Would Nginx work in such a use case? Any tips on how to use Nginx for serving static media? Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,194884,194884#msg-194884 From sweeks at imvu.com Mon May 2 04:54:17 2011 From: sweeks at imvu.com (Stephen Weeks) Date: Sun, 1 May 2011 17:54:17 -0700 Subject: Crash (double free or corruption) on trying to proxy to localhost Message-ID: I've currently got a pool of systems running nginx proxying to a pool of systems running apache. I'm trying to move to running nginx locally on the apache hosts instead of separate systems to avoid the extra network hop, make more-efficient use of resources, and enable some future development (including migrating to running our application on nginx via fastcgi instead of apache, ideally). we've currently got some significant architecture built up around apache, so converting right now is uncomfortable. Ideally, I'd like nginx to just serve from localhost, but fail over to the rest of the pool when localhost in unavailable, so in my upstream I have every server except for localhost set as 'backup'. I'm otherwise running identical configurations of apache and nginx on a single system together as used in the rest of the two pools. This works exactly as expected, except that I get a few crashes of nginx workers every minute. This only happens when proxying to the local system. If I proxy anywhere else, it works fine. Other proxies can serve from this system without trouble. I see this same behaviour on other hosts when I build them the same way, so it's not an error with the host. I see this crash on 0.7.65, 0.8.54, and 1.0.0, running on Ubuntu 10.04 LTS. I see this crash whether I'm connecting to 127.0.0.1 or the host's local IP. I see this crash whether I'm listening on *:80 or :80. I see this crash whether I'm connecting to :80 or running apache on a different port and connecting to :81. I see this crash whether I'm running ubuntu's "nginx-light" configuration, or their "nginx-full" configuration. I see no errors logged from apache. 1) I'd really love to make this work, so if there's anything else I can try, any additional debugging information I can give, I'd appreciate it. 2) Nginx has been very useful to me so far, so I thought you'd appreciate a bug report. Posted on github, I have a problem description, section of a debug log, my (slightly edited: flattened includes and stripped an IP) nginx.conf, a gdb backtrace, and some additional information I was asked for when looking for help on IRC. This is everything I've been able to come up with that sounds plausibly relevant. https://gist.github.com/1574dbaf3a3dcda920a2 Any help? (Thanks to MTechnology and kolbyjack for helping me troubleshoot this on IRC) -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Mon May 2 05:54:27 2011 From: nginx-forum at nginx.us (jjjx128) Date: Sun, 01 May 2011 21:54:27 -0400 Subject: Does Nginx block on file IO? In-Reply-To: References: Message-ID: Andy Wrote: ------------------------------------------------------- > I was always under the impression that Nginx is > non-blocking for file IO. Then I was told it > wasn't. Actually AIO support was added not so long ago. It can be non-blocking for file IO on systems with AIO. > If Nginx blocks for file IO, then > using Nginx here wouldn't be any better than using > Apache, right? How is it even related? There is a difference between getting a file from disk and serving it to the client from buffer. You can get it really fast and block for a very little time but than send it to the client very slowly. So asynchronous front-end would be a really good idea. Other than that you might find that neither nginx nor apache can serve your images fast enough from any common filesystem. You will need something like Bitcask to go farther. The idea is to get an entire image to the buffer in a single disk seek. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,194884,194891#msg-194891 From nginx-forum at nginx.us Mon May 2 06:59:51 2011 From: nginx-forum at nginx.us (flubber) Date: Sun, 01 May 2011 22:59:51 -0400 Subject: nginx and php fast cgi different server? Message-ID: Hello All, I'm a newbie on nginx, currently i have configure nginx n php fast cgi with same server, i want to split nginx and php fast cgi with different, it's posibble? I have test change fastcgi_pass point di php fast cgi to other server, but when access site just get "No input file specified." and no error report. This my configuration. location ~ \.php$ { #fastcgi_pass 127.0.0.1:9000; fastcgi_pass 10.1.1.10:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name; include fastcgi_params; } My nginx nginx/0.9.6, please advice and suggestion Thx all. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,194899,194899#msg-194899 From edhoprima at gmail.com Mon May 2 07:02:49 2011 From: edhoprima at gmail.com (Edho P Arief) Date: Mon, 2 May 2011 10:02:49 +0700 Subject: nginx and php fast cgi different server? In-Reply-To: References: Message-ID: On Mon, May 2, 2011 at 9:59 AM, flubber wrote: > Hello All, > > I'm a newbie on nginx, currently i have configure nginx n php fast cgi > with same server, i want to split nginx and php fast cgi with different, > it's posibble? > > I have test change fastcgi_pass point di php fast cgi to other server, > but when access site just get "No input file specified." and no error > report. > > This my configuration. > > ? ? ? ?location ~ \.php$ { > ? ? ? ? ? ? ? ?#fastcgi_pass ? 127.0.0.1:9000; > ? ? ? ? ? ? ? ?fastcgi_pass ? 10.1.1.10:9000; > ? ? ? ? ? ? ? ?fastcgi_index ?index.php; > ? ? ? ? ? ? ? ?fastcgi_param ?SCRIPT_FILENAME > /var/www/html$fastcgi_script_name; > ? ? ? ? ? ? ? ?include fastcgi_params; > ? ? ? ?} > > My nginx nginx/0.9.6, please advice and suggestion > the fastcgi files (in this case, php files) must be located in the other server (10.1.1.10 in this case) From sweeks at imvu.com Mon May 2 07:13:42 2011 From: sweeks at imvu.com (Stephen Weeks) Date: Sun, 1 May 2011 20:13:42 -0700 Subject: Crash (double free or corruption) on trying to proxy to localhost In-Reply-To: References: Message-ID: Apparently these crashed don't happen with the upstreamfair module, as far as I've been able to tell so far. That's probably good enough as a workaround for me for now, and may be a clue when investigating this crash. On Sun, May 1, 2011 at 5:54 PM, Stephen Weeks wrote: > I've currently got a pool of systems running nginx proxying to a pool of > systems running apache. I'm trying to move to running nginx locally on the > apache hosts instead of separate systems to avoid the extra network hop, > make more-efficient use of resources, and enable some future development > (including migrating to running our application on nginx via fastcgi instead > of apache, ideally). we've currently got some significant architecture > built up around apache, so converting right now is uncomfortable. > > Ideally, I'd like nginx to just serve from localhost, but fail over to the > rest of the pool when localhost in unavailable, so in my upstream I have > every server except for localhost set as 'backup'. I'm otherwise running > identical configurations of apache and nginx on a single system together as > used in the rest of the two pools. This works exactly as expected, except > that I get a few crashes of nginx workers every minute. This only happens > when proxying to the local system. If I proxy anywhere else, it works > fine. Other proxies can serve from this system without trouble. I see this > same behaviour on other hosts when I build them the same way, so it's not an > error with the host. I see this crash on 0.7.65, 0.8.54, and 1.0.0, running > on Ubuntu 10.04 LTS. I see this crash whether I'm connecting to 127.0.0.1 > or the host's local IP. I see this crash whether I'm listening on *:80 or > :80. I see this crash whether I'm connecting to :80 or running > apache on a different port and connecting to :81. I see this crash whether > I'm running ubuntu's "nginx-light" configuration, or their "nginx-full" > configuration. I see no errors logged from apache. > > 1) I'd really love to make this work, so if there's anything else I can > try, any additional debugging information I can give, I'd appreciate it. > 2) Nginx has been very useful to me so far, so I thought you'd appreciate a > bug report. > > Posted on github, I have a problem description, section of a debug log, my > (slightly edited: flattened includes and stripped an IP) nginx.conf, a gdb > backtrace, and some additional information I was asked for when looking for > help on IRC. This is everything I've been able to come up with that sounds > plausibly relevant. > > https://gist.github.com/1574dbaf3a3dcda920a2 > > Any help? > > (Thanks to MTechnology and kolbyjack for helping me troubleshoot this on > IRC) > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Mon May 2 08:08:24 2011 From: lists at ruby-forum.com (Mike P.) Date: Mon, 02 May 2011 06:08:24 +0200 Subject: 502 errors, upstream sent too big header In-Reply-To: References: Message-ID: <79524ba8fb1d2c8fb975fab30434c302@ruby-forum.com> Hi, I'm getting this same error (please see log output below) with Nginx(0.8.54) and Passenger(3.0.6) using GET requests with really long URIs. My assumption is that fastcgi_buffer* directives won't apply to my configuration since the request is being handled by passenger instead of a php/perl fastcgi socket. I've tried defining the proxy_buffer* settings like Travis described in his initial post, but that didn't resolve the error I'm experiencing. I've defined "large_client_header_buffers 8 16k;" in the server context, but this doesn't alleviate the error either. Is 'large_client_header_buffers' the proper directive I should be using? If not, is there a directive I can use to increase the response header size limit? Thanks for any insight into this, Mike P. ---------- 2011/05/01 09:57:41 [error] 12176#0: *4537092 upstream sent too big header while reading response header from upstream, client: x.x.x.x, server: hostname.tld, request: "GET /heroku/resources/18623? HTTP/1.1", upstream: "passenger:unix:/ ---------- -- Posted via http://www.ruby-forum.com/. From nginx-forum at nginx.us Mon May 2 08:11:10 2011 From: nginx-forum at nginx.us (HowToMeetLadies) Date: Mon, 02 May 2011 00:11:10 -0400 Subject: Catch ALL requests by LUA-script In-Reply-To: References: Message-ID: <90c728b1bd4f045a01171963ba75b30f.NginxMailingListEnglish@forum.nginx.org> Maybe slightly off-topic but then maybe it is useful for you (andiL) or someone else. Before i start, @agentzh: every ?nth request, one of nginx (0.8.54.4rc2-jit2beta6) worker processes segfaults, is this behaviour related to the pcre issue? have not patched it yet.. ah and thank you *very* much for giving nginx this all new powers!! ((: Ok, im a long time nginx/redis/ruby user and this are my first steps with lua and a lightweight (M)VC framework around three core "classes", which uses haml for templates/layout and markdown for text processing (5 minute ffi discount binding), drizzle and redis for data and redis also for caching. Successfully running a little app with it. yay! *.* For now i can give you some snippets just to show some basic aspects, ill release a fully working example sometime soon, if the segfaults doesnt belong to the pcre-issue ill try to debug that too. Below ill use luasql, instead you can use ngx.location.capture("/some-internal-rds-json") and lua-yajl, but this approach ends as soon as you want INSERT followed by LAST_INSERT_ID() or other complex queries/transactions (as long as libdrizzle has no support for multiple queries, maybe this is not the best option to go with, ive tried alternatives and workarounds, but for now this is what *I* want). At the moment i do not need an ORM for my data, but have already done some functions for both rds_json and luasql. redis has some commands exposed in nginx.conf for easy access with lua (: The core classes: Request; which contains several ngx.var wrappers (for nil instead of '' for empty keys), present(str), simple cookie/session/login, before/after filters, haml/markdown rendering, etc.. MethodRequest < Request; which calls functions for HTTP Methods aka GET, POST alike.. and finally Resource < MethodRequest; which has an Rails-ActionController-like interface. Greetz # HTML --- ATTACHMENT --- ookeh to bad no code formatting...? http://exc.eu/paste/deadbeaf.txt Posted at Nginx Forum: http://forum.nginx.org/read.php?2,179364,194903#msg-194903 From nginx-forum at nginx.us Mon May 2 08:26:29 2011 From: nginx-forum at nginx.us (flubber) Date: Mon, 02 May 2011 00:26:29 -0400 Subject: nginx and php fast cgi different server? In-Reply-To: References: Message-ID: <037843eb881f9c7979186de05bb8d829.NginxMailingListEnglish@forum.nginx.org> it's works, thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,194899,194905#msg-194905 From nginx-forum at nginx.us Mon May 2 09:15:08 2011 From: nginx-forum at nginx.us (moorthi) Date: Mon, 02 May 2011 01:15:08 -0400 Subject: nginx imaps auth_http cyrus In-Reply-To: <3f29c76ca3fec62ea3f4f3423b70de4e.NginxMailingListEnglish@forum.nginx.org> References: <4D73FB1E.3090104@alokat.org> <3f29c76ca3fec62ea3f4f3423b70de4e.NginxMailingListEnglish@forum.nginx.org> Message-ID: <8599d7049c20a5f08721167b39775a44.NginxMailingListEnglish@forum.nginx.org> auth_http script and other setttings are done correctly, this is what i am getting in error.log upstream timed out (111: Connection timed out) while connecting to upstream it's saying +OK for user in connect but after entering pass it's giving above error. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,180902,194908#msg-194908 From piotr.sikora at frickle.com Mon May 2 09:22:52 2011 From: piotr.sikora at frickle.com (Piotr Sikora) Date: Mon, 2 May 2011 07:22:52 +0200 Subject: Does Nginx block on file IO? In-Reply-To: References: Message-ID: Hi, > I was always under the impression that Nginx is non-blocking for file > IO. Then I was told it wasn't. That depends on your configuration on on capabilities of your operating system. Asynchronous file I/O is available on recent versions of Linux, Solaris, DragonFly, FreeBSD, NetBSD, MacOSX. > I'm considering using Nginx to serve static images. Pretty much every > connection will result in a file IO. No, it won't. Recently served files should be in your OS's buffer cache. > If Nginx blocks for file IO, then > using Nginx here wouldn't be any better than using Apache, right? Every > connection will lead to a file IO which blocks the entire Nginx process. > So to serve 500 concurrent connections I'll need 500 Nginx processes. If that would be the case (buffer cache hit rate would be very low) and you would be using magnetic disks, then yes, you'd be better off with a web server than uses per-client lightweight processes or threads. Best regards, Piotr Sikora < piotr.sikora at frickle.com > From piotr.sikora at frickle.com Mon May 2 09:29:30 2011 From: piotr.sikora at frickle.com (Piotr Sikora) Date: Mon, 2 May 2011 07:29:30 +0200 Subject: Does Nginx block on file IO? In-Reply-To: References: Message-ID: Hi, > How is it even related? There is a difference between getting a file > from disk and serving it to the client from buffer. You can get it > really fast and block for a very little time but than send it to the > client very slowly. It's actually very related, because with event-driven programming, you're blocking _all_ worker's clients on the single disk I/O. Best regards, Piotr Sikora < piotr.sikora at frickle.com > From justin at specialbusservice.com Mon May 2 15:06:41 2011 From: justin at specialbusservice.com (Justin Cormack) Date: Mon, 02 May 2011 12:06:41 +0100 Subject: Does Nginx block on file IO? In-Reply-To: References: Message-ID: <1304334401.2438.145.camel@mackerel> On Mon, 2011-05-02 at 07:29 +0200, Piotr Sikora wrote: > Hi, > > > How is it even related? There is a difference between getting a file > > from disk and serving it to the client from buffer. You can get it > > really fast and block for a very little time but than send it to the > > client very slowly. > > It's actually very related, because with event-driven programming, you're > blocking _all_ worker's clients on the single disk I/O. If you expect file IO to block, use more nginx processes than cores. I dont think that async IO on Linux is really worth using, although I will do some benchmarks. You might try switching to FreeBSD as well. I think that node.js currently uses a thread pool for async IO on Linux (possibly all platforms, except maybe Windows), with sync IO in the background. Linux kernel aio was designed for programs like databases that manage their own buffer caches, not for normal file IO. If you dont cache the results it will be slow (unless anything has changed recently, will do some testing). Justin From nginx-forum at nginx.us Mon May 2 15:17:08 2011 From: nginx-forum at nginx.us (jjjx128) Date: Mon, 02 May 2011 07:17:08 -0400 Subject: Does Nginx block on file IO? In-Reply-To: References: Message-ID: Piotr Sikora Wrote: ------------------------------------------------------- > It's actually very related, because with > event-driven programming, you're > blocking _all_ worker's clients on the single disk > I/O. I know, but imagine how much memory you can save and use for file system cache if you are not running apache. Which can make fat more greater impact on your performance. You can't just say that nginx is the same as apache just because it's blocking on file I/O. So still, it depends on the type of load you are having. And if you are not serving 100 megabytes of data to 500 clients but a lot more you are most likely to get better results with asynchronous server even with blocking file I/O. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,194884,194939#msg-194939 From nginx-forum at nginx.us Mon May 2 15:25:54 2011 From: nginx-forum at nginx.us (jjjx128) Date: Mon, 02 May 2011 07:25:54 -0400 Subject: Does Nginx block on file IO? In-Reply-To: References: Message-ID: <8343634767e2d40d5164389d05e4884f.NginxMailingListEnglish@forum.nginx.org> jjjx128 Wrote: ------------------------------------------------------- > And if you are not serving 100 megabytes > of data to 500 clients but a lot more you are most > likely to get better results with asynchronous > server even with blocking file I/O. Sorry, bad example, in this case your data will fit in file system cache and you still will be better off with nginx bacuase of all the context switches you save. Anyway there might be some very special case where disks are overloaded and access patterns are truly random. Although this never happens in real world. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,194884,194941#msg-194941 From markus.jelsma at openindex.io Mon May 2 16:56:19 2011 From: markus.jelsma at openindex.io (Markus Jelsma) Date: Mon, 2 May 2011 14:56:19 +0200 Subject: Using map and proxy_pass In-Reply-To: <201104301252.43466.markus.jelsma@openindex.io> References: <201104291748.48357.markus.jelsma@openindex.io> <201104301252.43466.markus.jelsma@openindex.io> Message-ID: <201105021456.19711.markus.jelsma@openindex.io> Anyone else having some thoughs on how to use the map in conjunction with proxy_pass to set different hosts based on the first URI segment? On Saturday 30 April 2011 12:52:42 Markus Jelsma wrote: > Too many. I need to generate the mappings in an external program. I'd > rather not generate as many different locations. > > > Thanks > > > How many uri / backend mappings do you have? You could perform the > > above in two straight forward location blocks, based on the uri. > > > > location /abc { > > > > proxy_pass http://host01:8080; > > } > > > > .... > > > > Posted at Nginx Forum: > > http://forum.nginx.org/read.php?2,194480,194616#msg-194616 > > > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx -- Markus Jelsma - CTO - Openindex http://www.linkedin.com/in/markus17 050-8536620 / 06-50258350 From nginx-forum at nginx.us Mon May 2 18:22:50 2011 From: nginx-forum at nginx.us (monster) Date: Mon, 02 May 2011 10:22:50 -0400 Subject: How to get a 404 logged with try_files? Message-ID: Hi! Just started with Nginx after reading it reached 1.0. Congratulation! I'm trying to get my test site to return a "missing image" icon when an image is missing, but have a 404 logged so I know I messed up something. I want to specify the images name without file extensions, in case I move some from PNG to JPG, or the other way around. My problem is that try_files doc says last path MUST exist. I would like last path to be $uri and cause a 404, not a 500. Tried using error_page to convert 500 to 404, but did not have any effect. Thanks for any advice! location ~ ^/img/[^\.]*$ { try_files $uri.png $uri.jpg $uri.gif $uri; error_page 500 =404 /img/missing; } location /img/ { error_page 404 /img/missing; } location = /img/missing { rewrite .* /img/icon/missing.png; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,194965,194965#msg-194965 From francis at daoine.org Mon May 2 19:35:31 2011 From: francis at daoine.org (Francis Daly) Date: Mon, 2 May 2011 16:35:31 +0100 Subject: Using map and proxy_pass In-Reply-To: <201105021456.19711.markus.jelsma@openindex.io> References: <201104291748.48357.markus.jelsma@openindex.io> <201104301252.43466.markus.jelsma@openindex.io> <201105021456.19711.markus.jelsma@openindex.io> Message-ID: <20110502153531.GB12564@craic.sysops.org> On Mon, May 02, 2011 at 02:56:19PM +0200, Markus Jelsma wrote: Hi there, A general rule for most config confusions is "the debug log is your friend". > Anyone else having some thoughs on how to use the map in conjunction with > proxy_pass to set different hosts based on the first URI segment? It's not clear to me why you're happy to generate an include file of mappings in an external program, but not happy to generate an include file of locations in an external program. And if you have a large number of locations, you'll probably be happier having no top-level regex locations. But all that aside... "map $var1 $var2" sets $var2 based on a string match of $var1. You wish to match based on the first uri segment. So, do just that: === http { map $first_segment $value { default 127.0.0.1; /abc 127.0.0.2; /def 127.0.0.3; } server { if ($uri ~* ^(/[^/]*) ) { set $first_segment $1; } location / { proxy_pass http://$value:8080/$uri ; } } } === You may want to play with the proxy_pass line depending on exactly what you want to do, but the above seems to work for me. You can also add a $second_segment (or $part2) in the if{} block, if you want a separate map for that. Good luck with it, f -- Francis Daly francis at daoine.org From lists at ruby-forum.com Mon May 2 21:54:57 2011 From: lists at ruby-forum.com (Yanxin Z.) Date: Mon, 02 May 2011 19:54:57 +0200 Subject: nginx rewrite Message-ID: <721e551f14c3665cad91466a13a63001@ruby-forum.com> Hello, I need to rewrite the URL /img/14567.jpg to /img/14/14567.jpg The image name is 14567.jpg, which is saved in /14 folder. /14 is caluculated by 14567 / 1000 How to implement is NGX rewrite? Thanks, Yanxin -- Posted via http://www.ruby-forum.com/. From cliff at develix.com Mon May 2 22:11:04 2011 From: cliff at develix.com (Cliff Wells) Date: Mon, 02 May 2011 11:11:04 -0700 Subject: Does Nginx block on file IO? In-Reply-To: References: Message-ID: <1304359864.11635.47.camel@portable-evil> On Sun, 2011-05-01 at 20:26 -0400, Andy wrote: > Hi. > > I was always under the impression that Nginx is non-blocking for file > IO. Then I was told it wasn't. > > I'm considering using Nginx to serve static images. Pretty much every > connection will result in a file IO. If Nginx blocks for file IO, then > using Nginx here wouldn't be any better than using Apache, right? Every > connection will lead to a file IO which blocks the entire Nginx process. > So to serve 500 concurrent connections I'll need 500 Nginx processes. You cannot take a single measure such as concurrent requests independent of requests per second and make a good prediction about performance requirements. If you have 500 concurrent requests, and each request takes an average of 1ms, then you could conceivably serve all 500 requests within 0.5 seconds with a single worker, which is quite reasonable. People have reported serving 10K requests per second using Nginx on rather modest hardware (laptops even). You'll probably find that your OS is the bottleneck, not Nginx (and you should focus your performance tuning at that level - TCP buffers and the like). It's also worth pointing out that if you currently have 500 concurrent requests on Apache, that number may actually decrease with Nginx, assuming requests are finished faster (i.e. if Nginx finishes each request twice as fast as Apache, you'd only see 250 concurrent requests, while requests per second would double). Obviously that's simplified, but hopefully clarifies my point. In any case, no need to have a worker per request, just start with the recommendation of 1 worker per core and tune from there. It's true that the *concurrent* number of requests is limited by the number of workers you have (the remaining requests will be served serially as each worker is freed), but in practice, it becomes academic. Serialization is going to happen at some level, even if you have a threaded server, so basically software threads buy you little more than the feeling of concurrency at the cost of massive amounts of memory. > Would Nginx work in such a use case? Any tips on how to use Nginx for > serving static media? Serving static content is actually where Nginx has been demonstrated to outperform Apache by a wide margin, in no small part because it leaves lots of memory for filesystem caching, and also because it causes less context-switches than a threaded server. At the end of the day, you should do some performance testing, since performance is going to depend a lot on factors that will only be revealed on your particular setup and your particular data (number and size of files, cache misses, etc). Regards, Cliff From igor at sysoev.ru Mon May 2 22:11:31 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Mon, 2 May 2011 22:11:31 +0400 Subject: nginx rewrite In-Reply-To: <721e551f14c3665cad91466a13a63001@ruby-forum.com> References: <721e551f14c3665cad91466a13a63001@ruby-forum.com> Message-ID: <20110502181131.GF43927@sysoev.ru> On Mon, May 02, 2011 at 07:54:57PM +0200, Yanxin Z. wrote: > Hello, > I need to rewrite the URL > > /img/14567.jpg to /img/14/14567.jpg > > The image name is 14567.jpg, which is saved in /14 folder. /14 is > caluculated by 14567 / 1000 > > How to implement is NGX rewrite? location /img/ { location ~ ^/img/(..)(.+)$ { alias /path/to/img/$1/$1$2; } } -- Igor Sysoev From nginx-forum at nginx.us Mon May 2 22:21:48 2011 From: nginx-forum at nginx.us (monster) Date: Mon, 02 May 2011 14:21:48 -0400 Subject: How to get a 404 logged with try_files? In-Reply-To: References: Message-ID: Found it! It must look like this, putting =404 as last location in try_files: location ~ ^/img/[^\.]*$ { try_files $uri.png $uri.jpg $uri.gif $uri =404; error_page 404 /img/missing; } That would be useful information to put in the try_files wiki... Posted at Nginx Forum: http://forum.nginx.org/read.php?2,194965,195019#msg-195019 From lists at ruby-forum.com Mon May 2 22:48:50 2011 From: lists at ruby-forum.com (Yanxin Z.) Date: Mon, 02 May 2011 20:48:50 +0200 Subject: nginx rewrite In-Reply-To: <721e551f14c3665cad91466a13a63001@ruby-forum.com> References: <721e551f14c3665cad91466a13a63001@ruby-forum.com> Message-ID: Hello Igor Sysoev, Thank you for your help. You suggestion is great, but my problem is a little bit complicated. The image name is flexible, can be from 0.jpg to 23456.jpg, we organize the image files into folders, whose name is the number divide by 1000. For example, the folder 100 saves the file 100000.jpg to 100999.jpg. Both the folder and file name are flexible in my case. Do you have any suggestion on it? Thanks, Yanxin -- Posted via http://www.ruby-forum.com/. From mdounin at mdounin.ru Mon May 2 22:53:27 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 2 May 2011 22:53:27 +0400 Subject: nginx imaps auth_http cyrus In-Reply-To: <8599d7049c20a5f08721167b39775a44.NginxMailingListEnglish@forum.nginx.org> References: <4D73FB1E.3090104@alokat.org> <3f29c76ca3fec62ea3f4f3423b70de4e.NginxMailingListEnglish@forum.nginx.org> <8599d7049c20a5f08721167b39775a44.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110502185327.GD42265@mdounin.ru> Hello! On Mon, May 02, 2011 at 01:15:08AM -0400, moorthi wrote: > auth_http script and other setttings are done correctly, > this is what i am getting in error.log > upstream timed out (111: Connection timed out) while connecting to > upstream I believe this is clear enough: nginx wasn't able to connect to upstream (backend) server. Check backend server and port returned by auth_http script. > it's saying +OK for user in connect > but after entering pass it's giving above error. After PASS command nginx will try to authenticate client with auth_http script and then connect to upstream (backend) server. As soon as connection to upstream times out - nginx should return "-ERR internal server error" in reply to PASS command (if client is still here). Maxim Dounin From mdounin at mdounin.ru Mon May 2 22:57:03 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 2 May 2011 22:57:03 +0400 Subject: 502 errors, upstream sent too big header In-Reply-To: <79524ba8fb1d2c8fb975fab30434c302@ruby-forum.com> References: <79524ba8fb1d2c8fb975fab30434c302@ruby-forum.com> Message-ID: <20110502185703.GE42265@mdounin.ru> Hello! On Mon, May 02, 2011 at 06:08:24AM +0200, Mike P. wrote: > Hi, > > I'm getting this same error (please see log output below) with > Nginx(0.8.54) and Passenger(3.0.6) using GET requests with really long > URIs. > > My assumption is that fastcgi_buffer* directives won't apply to my > configuration since the request is being handled by passenger instead of > a php/perl fastcgi socket. You have to tune appropriate settings provided by passenger module. Please refer to passenger documentation for exact names, most likely passenger_buffer_size and so on. [...] Maxim Dounin From igor at sysoev.ru Mon May 2 22:57:16 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Mon, 2 May 2011 22:57:16 +0400 Subject: nginx rewrite In-Reply-To: References: <721e551f14c3665cad91466a13a63001@ruby-forum.com> Message-ID: <20110502185716.GG43927@sysoev.ru> On Mon, May 02, 2011 at 08:48:50PM +0200, Yanxin Z. wrote: > Hello Igor Sysoev, > Thank you for your help. > > You suggestion is great, but my problem is a little bit complicated. > > The image name is flexible, can be from 0.jpg to 23456.jpg, we organize > the image files into folders, whose name is the number divide by 1000. > For example, the folder 100 saves the file 100000.jpg to 100999.jpg. > > Both the folder and file name are flexible in my case. > > Do you have any suggestion on it? location /img/ { location ~ ^/img/(\d)(\.jpg)$ { alias /path/to/img/0$1/$1$2; } location ~ ^/img/(\d\d)(\d*\.jpg)$ { alias /path/to/img/$1/$1$2; } return 404; } -- Igor Sysoev From nginx-forum at nginx.us Mon May 2 23:04:48 2011 From: nginx-forum at nginx.us (dbanks) Date: Mon, 02 May 2011 15:04:48 -0400 Subject: Shared nginx configuration for multiple servers In-Reply-To: References: Message-ID: I'm facing a related issue, although my attempt at implementation is different from the OP. ip.conf: set $server_ip 10.11.1.50; nginx.conf: ... server { include ip.conf; #adds the $server_ip variable which is machine-specific listen $server_ip:80 default_server; ... } This fails with: nginx: [emerg] host not found in "$server_ip:80" of the "listen" directive in /opt/nginx/conf/nginx.conf:48 What is the best way to include a hard-coded IP address from another file in order to allow nginx.conf to be universal across deployed machines? Cheers, Dean Posted at Nginx Forum: http://forum.nginx.org/read.php?2,188621,195032#msg-195032 From mdounin at mdounin.ru Mon May 2 23:19:06 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 2 May 2011 23:19:06 +0400 Subject: nginx rewrite In-Reply-To: <20110502185716.GG43927@sysoev.ru> References: <721e551f14c3665cad91466a13a63001@ruby-forum.com> <20110502185716.GG43927@sysoev.ru> Message-ID: <20110502191906.GF42265@mdounin.ru> Hello! On Mon, May 02, 2011 at 10:57:16PM +0400, Igor Sysoev wrote: > On Mon, May 02, 2011 at 08:48:50PM +0200, Yanxin Z. wrote: > > Hello Igor Sysoev, > > Thank you for your help. > > > > You suggestion is great, but my problem is a little bit complicated. > > > > The image name is flexible, can be from 0.jpg to 23456.jpg, we organize > > the image files into folders, whose name is the number divide by 1000. > > For example, the folder 100 saves the file 100000.jpg to 100999.jpg. > > > > Both the folder and file name are flexible in my case. > > > > Do you have any suggestion on it? > > location /img/ { > > location ~ ^/img/(\d)(\.jpg)$ { > alias /path/to/img/0$1/$1$2; > } > > location ~ ^/img/(\d\d)(\d*\.jpg)$ { > alias /path/to/img/$1/$1$2; > } > > return 404; > } As far as I understand original question, the following should work (same as above, but fixed to use division by 1000 instead of two first digits): location /img/ { location ~ ^/img/(\d+)(\d\d\d\.jpg)$ { alias /path/to/img/$1/$1$2; } location ~ ^/img/(\d+\.jpg)$ { alias /path/to/img/0/$1; } return 404; } Maxim Dounin From mdounin at mdounin.ru Mon May 2 23:26:17 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 2 May 2011 23:26:17 +0400 Subject: Shared nginx configuration for multiple servers In-Reply-To: References: Message-ID: <20110502192617.GG42265@mdounin.ru> Hello! On Mon, May 02, 2011 at 03:04:48PM -0400, dbanks wrote: > I'm facing a related issue, although my attempt at implementation is > different from the OP. > > ip.conf: > set $server_ip 10.11.1.50; > > nginx.conf: > ... > server { > include ip.conf; #adds the $server_ip variable which is > machine-specific > listen $server_ip:80 default_server; > ... > } > > This fails with: nginx: [emerg] host not found in "$server_ip:80" of > the "listen" directive in /opt/nginx/conf/nginx.conf:48 > > What is the best way to include a hard-coded IP address from another > file in order to allow nginx.conf to be universal across deployed > machines? Variable are evaluated at runtime during request processing, you can't use them to configure listening sockets. Either place full listen directive in included file or use some external scripting to produce actual config. Maxim Dounin From lists at ruby-forum.com Mon May 2 23:29:55 2011 From: lists at ruby-forum.com (Yanxin Z.) Date: Mon, 02 May 2011 21:29:55 +0200 Subject: nginx rewrite In-Reply-To: <721e551f14c3665cad91466a13a63001@ruby-forum.com> References: <721e551f14c3665cad91466a13a63001@ruby-forum.com> Message-ID: <3f4dd13fbd8403d956188afc8bc69fd5@ruby-forum.com> Thank you Maxim and Igor. It's working for me. Yanxin -- Posted via http://www.ruby-forum.com/. From mdounin at mdounin.ru Tue May 3 01:04:56 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 3 May 2011 01:04:56 +0400 Subject: Crash (double free or corruption) on trying to proxy to localhost In-Reply-To: References: Message-ID: <20110502210456.GH42265@mdounin.ru> Hello! On Sun, May 01, 2011 at 05:54:17PM -0700, Stephen Weeks wrote: > I've currently got a pool of systems running nginx proxying to a pool of > systems running apache. I'm trying to move to running nginx locally on the > apache hosts instead of separate systems to avoid the extra network hop, > make more-efficient use of resources, and enable some future development > (including migrating to running our application on nginx via fastcgi instead > of apache, ideally). we've currently got some significant architecture > built up around apache, so converting right now is uncomfortable. > > Ideally, I'd like nginx to just serve from localhost, but fail over to the > rest of the pool when localhost in unavailable, so in my upstream I have > every server except for localhost set as 'backup'. I'm otherwise running > identical configurations of apache and nginx on a single system together as > used in the rest of the two pools. This works exactly as expected, except > that I get a few crashes of nginx workers every minute. This only happens > when proxying to the local system. If I proxy anywhere else, it works > fine. Other proxies can serve from this system without trouble. I see this > same behaviour on other hosts when I build them the same way, so it's not an > error with the host. I see this crash on 0.7.65, 0.8.54, and 1.0.0, running > on Ubuntu 10.04 LTS. I see this crash whether I'm connecting to 127.0.0.1 > or the host's local IP. I see this crash whether I'm listening on *:80 or > :80. I see this crash whether I'm connecting to :80 or running > apache on a different port and connecting to :81. I see this crash whether > I'm running ubuntu's "nginx-light" configuration, or their "nginx-full" > configuration. I see no errors logged from apache. > > 1) I'd really love to make this work, so if there's anything else I can try, > any additional debugging information I can give, I'd appreciate it. > 2) Nginx has been very useful to me so far, so I thought you'd appreciate a > bug report. > > Posted on github, I have a problem description, section of a debug log, my > (slightly edited: flattened includes and stripped an IP) nginx.conf, a gdb > backtrace, and some additional information I was asked for when looking for > help on IRC. This is everything I've been able to come up with that sounds > plausibly relevant. > > https://gist.github.com/1574dbaf3a3dcda920a2 > > Any help? Could you please provide: 1. nginx -V output 2. Full debug log for '*60' connection (the one which triggered abort in glibc), the one you provided contatins only last part of the connection in question. Running grep -F ' 27772#0: *60 ' on original debug log should produce something useable. Maxim Dounin From ionathan at gmail.com Tue May 3 02:00:18 2011 From: ionathan at gmail.com (Jonathan Leibiusky) Date: Mon, 2 May 2011 19:00:18 -0300 Subject: reloading conf Message-ID: Hi! How reloading my conf can affect my running nginx instances that are under load? Just made a small test and I saw that some requests to the upstream are being lost. I am reloading the same configuration I had, didn't change anything. Is there any best practice on how to do it? how often? if I should avoid something in particular? etc... Thanks for your help! Jonathan -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Tue May 3 02:35:50 2011 From: nginx-forum at nginx.us (chiefops) Date: Mon, 02 May 2011 18:35:50 -0400 Subject: domain rewrite/redirect Message-ID: <9846569c04e02f90d5435cd81c105ee3.NginxMailingListEnglish@forum.nginx.org> I have two different domains. One is a shortened url for referrals. I want to be able redirect the host name from the short url with parameters to the actual url. For example: abcd.com/123456 rewrite/redirect to efgh.com/referrals/123456 Initially I used a CNAME setup for adbcd.com to rewrite to efgh.com but that doesn't rewrite the domain name or url. Here's a short version of my setup with the rewrite rules I'm trying to use: http { server { listen 80; server_name abcd.com efgh.com; rewrite ^(.*) https://$host$1 permanent; } server { listen 443; server_name abcd.com efgh.com; if ($host ~* ^(efgh\.com)$ ) { rewrite ^/(.*)$ https://abcd.com/referrals/$ redirect; } } } The url on the user's browser after entering https://efgh.com/123456 should appear as https://abcd.com/referrals/123456. Currently, it's just rewriting. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,195075,195075#msg-195075 From nginx-forum at nginx.us Tue May 3 03:05:04 2011 From: nginx-forum at nginx.us (chiefops) Date: Mon, 02 May 2011 19:05:04 -0400 Subject: domain rewrite/redirect In-Reply-To: <9846569c04e02f90d5435cd81c105ee3.NginxMailingListEnglish@forum.nginx.org> References: <9846569c04e02f90d5435cd81c105ee3.NginxMailingListEnglish@forum.nginx.org> Message-ID: I think I'm getting a bit further. I modified this a bit and its redirecting but not carrying the parameters. Here's the updated config: http { server { listen 80; server_name abcd.com; rewrite ^(.*) https://$host$1 permanent; } server { listen 80; server_name efgh.com; rewrite ^(.*) https://abcd.com/referrals/$1 redirect; } server { listen 443; server_name abcd.com; } server { listen 443; server efgh.com rewrite ^(.*) https://abcd.com/referrals/$1 permanent; } } } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,195075,195084#msg-195084 From sweeks at imvu.com Tue May 3 03:45:13 2011 From: sweeks at imvu.com (Stephen Weeks) Date: Mon, 2 May 2011 16:45:13 -0700 Subject: Crash (double free or corruption) on trying to proxy to localhost In-Reply-To: <20110502210456.GH42265@mdounin.ru> References: <20110502210456.GH42265@mdounin.ru> Message-ID: Sure! I've added it to the post on github. I've slightly edited the log out of paranoia (replacing a customer ID and auth key). I can confirm now that I ran this proxy with the upstreamfair module overnight and it didn't crash at all. I can't get it to preferentially serve to localhost, though, as it doesn't support 'backup' as a server attribute, and doesn't seem to really use the weights, so that's suboptimal. Anything else I can add to help troubleshooting this? Anything you'd like from the core dump? On Mon, May 2, 2011 at 2:04 PM, Maxim Dounin wrote: > Hello! > > On Sun, May 01, 2011 at 05:54:17PM -0700, Stephen Weeks wrote: > > > I've currently got a pool of systems running nginx proxying to a pool of > > systems running apache. I'm trying to move to running nginx locally on > the > > apache hosts instead of separate systems to avoid the extra network hop, > > make more-efficient use of resources, and enable some future development > > (including migrating to running our application on nginx via fastcgi > instead > > of apache, ideally). we've currently got some significant architecture > > built up around apache, so converting right now is uncomfortable. > > > > Ideally, I'd like nginx to just serve from localhost, but fail over to > the > > rest of the pool when localhost in unavailable, so in my upstream I have > > every server except for localhost set as 'backup'. I'm otherwise running > > identical configurations of apache and nginx on a single system together > as > > used in the rest of the two pools. This works exactly as expected, > except > > that I get a few crashes of nginx workers every minute. This only > happens > > when proxying to the local system. If I proxy anywhere else, it works > > fine. Other proxies can serve from this system without trouble. I see > this > > same behaviour on other hosts when I build them the same way, so it's not > an > > error with the host. I see this crash on 0.7.65, 0.8.54, and 1.0.0, > running > > on Ubuntu 10.04 LTS. I see this crash whether I'm connecting to > 127.0.0.1 > > or the host's local IP. I see this crash whether I'm listening on *:80 > or > > :80. I see this crash whether I'm connecting to :80 or > running > > apache on a different port and connecting to :81. I see this crash > whether > > I'm running ubuntu's "nginx-light" configuration, or their "nginx-full" > > configuration. I see no errors logged from apache. > > > > 1) I'd really love to make this work, so if there's anything else I can > try, > > any additional debugging information I can give, I'd appreciate it. > > 2) Nginx has been very useful to me so far, so I thought you'd appreciate > a > > bug report. > > > > Posted on github, I have a problem description, section of a debug log, > my > > (slightly edited: flattened includes and stripped an IP) nginx.conf, a > gdb > > backtrace, and some additional information I was asked for when looking > for > > help on IRC. This is everything I've been able to come up with that > sounds > > plausibly relevant. > > > > https://gist.github.com/1574dbaf3a3dcda920a2 > > > > Any help? > > Could you please provide: > > 1. nginx -V output > > 2. Full debug log for '*60' connection (the one which triggered > abort in glibc), the one you provided contatins only last part of > the connection in question. Running grep -F ' 27772#0: *60 ' on > original debug log should produce something useable. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Tue May 3 03:55:11 2011 From: nginx-forum at nginx.us (chiefops) Date: Mon, 02 May 2011 19:55:11 -0400 Subject: domain rewrite/redirect In-Reply-To: <9846569c04e02f90d5435cd81c105ee3.NginxMailingListEnglish@forum.nginx.org> References: <9846569c04e02f90d5435cd81c105ee3.NginxMailingListEnglish@forum.nginx.org> Message-ID: <7b57cba3f10768842326d51ac87ced5f.NginxMailingListEnglish@forum.nginx.org> Nevermind, got if fixed on my end. Simple, just had to reread the wiki: rewrite ^ https://abcd.com/referrals$request_uri? permanent; Posted at Nginx Forum: http://forum.nginx.org/read.php?2,195075,195093#msg-195093 From mdounin at mdounin.ru Tue May 3 04:27:51 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 3 May 2011 04:27:51 +0400 Subject: reloading conf In-Reply-To: References: Message-ID: <20110503002750.GJ42265@mdounin.ru> Hello! On Mon, May 02, 2011 at 07:00:18PM -0300, Jonathan Leibiusky wrote: > Hi! How reloading my conf can affect my running nginx instances that are > under load? While reloading nginx master process parses new configuration, starts new worker processes and instructs old worker processes to gracefully terminate (i.e. finish processing of all requests and then exit). This shouldn't affect anything but may require additional resources (mostly memory). If you don't have enough memory reload may be problematic operation, and it's generally good idea to make sure your running nginx doesn't consume more than half of your server memory under normal load (to make sure it will be possible to start additional worker processes on reload). > Just made a small test and I saw that some requests to the upstream are > being lost. I am reloading the same configuration I had, didn't change > anything. It's strange you see something being lost. Are you sure you actually did reload (i.e. sent SIGHUP to nginx master process)? > Is there any best practice on how to do it? how often? if I should avoid > something in particular? etc... General practice is to reload config when you've changed it. If you are doing reloads often - you may want to make sure previous reload was completed (i.e. old workers terminated) before doing another one (there is nothing fatal if it's not, but see above about resources). Please note that with some use cases (long-running requests, downloads and so on) reload may take several hours or even more. Maxim Dounin From ionathan at gmail.com Tue May 3 05:02:21 2011 From: ionathan at gmail.com (Jonathan Leibiusky) Date: Mon, 2 May 2011 22:02:21 -0300 Subject: reloading conf In-Reply-To: <20110503002750.GJ42265@mdounin.ru> References: <20110503002750.GJ42265@mdounin.ru> Message-ID: Thanks! I will check it again. In general my nginx instances have very low cpu and memory usage, way beneath 50%, probably around 10% or even less. And request in our app are avg 200 or 300 ms, so no long running requests. We are serving around 15k req/s on 5 nginx instances (instance=machine), so maybe we have something wrong in the conf or something. Anyway, now I understand how it works, so it shouldn't affect anything. Thanks again! Jonathan On 5/2/11, Maxim Dounin wrote: > Hello! > > On Mon, May 02, 2011 at 07:00:18PM -0300, Jonathan Leibiusky wrote: > >> Hi! How reloading my conf can affect my running nginx instances that are >> under load? > > While reloading nginx master process parses new configuration, > starts new worker processes and instructs old worker processes to > gracefully terminate (i.e. finish processing of all requests and > then exit). > > This shouldn't affect anything but may require additional > resources (mostly memory). If you don't have enough memory reload > may be problematic operation, and it's generally good idea to make > sure your running nginx doesn't consume more than half of your > server memory under normal load (to make sure it will be possible > to start additional worker processes on reload). > >> Just made a small test and I saw that some requests to the upstream are >> being lost. I am reloading the same configuration I had, didn't change >> anything. > > It's strange you see something being lost. Are you sure you > actually did reload (i.e. sent SIGHUP to nginx master process)? > >> Is there any best practice on how to do it? how often? if I should avoid >> something in particular? etc... > > General practice is to reload config when you've changed it. > > If you are doing reloads often - you may want to make sure > previous reload was completed (i.e. old workers terminated) before > doing another one (there is nothing fatal if it's not, but see > above about resources). Please note that with some use cases > (long-running requests, downloads and so on) reload may take > several hours or even more. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > From lists at ruby-forum.com Tue May 3 06:03:29 2011 From: lists at ruby-forum.com (Mike P.) Date: Tue, 03 May 2011 04:03:29 +0200 Subject: 502 errors, upstream sent too big header In-Reply-To: References: Message-ID: According to passenger's documentation, it doesn't appear that a directive exists to adjust any header size limitations. Also, Phusion's CTO doesn't mention any possible solution here regarding the same error: http://goo.gl/ZPXvO If there is no such adjustment that can be made via passenger to alleviate this error, is there also no possible solution within Nginx? Thanks! -- Posted via http://www.ruby-forum.com/. From igor at sysoev.ru Tue May 3 08:19:01 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 3 May 2011 08:19:01 +0400 Subject: 502 errors, upstream sent too big header In-Reply-To: References: Message-ID: <20110503041901.GA84770@sysoev.ru> On Mon, Apr 04, 2011 at 04:52:22PM -0400, Travis Derouin wrote: > We seem to be getting sporadic 502 errors, mostly when users are logging in. > We run a Mediawiki based website, are running nginx 0.9.5, php-fpm 5.3.5. > > The error: > > 2011/04/04 10:41:34 [error] 30517#0: *2143711 upstream sent too big header > while reading response header from upstream, client: 192.168.100.5, server: > _, request: "POST > /index.php?title=Special:Userlogin&action=submitlogin&type=login&returnto=Main-Page > HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.wikihow.com", > referrer: "http://www.wikihow.com/Special:Userlogin?returnto=Main-Page" > > Our nginx.conf proxy buffer settings: > > proxy_buffers 16 16k; > proxy_buffer_size 32k; > > We've tried increasing these values from the defaults a few times, and it > doesn't seem to fix the issue. > > Do you have any suggestions on how to fix this? fastcgi_buffers 16 16k; fastcgi_buffer_size 32k; since you use fastcgi, but not proxy. -- Igor Sysoev From nginx-forum at nginx.us Tue May 3 10:09:45 2011 From: nginx-forum at nginx.us (moorthi) Date: Tue, 03 May 2011 02:09:45 -0400 Subject: nginx imaps auth_http cyrus In-Reply-To: <8599d7049c20a5f08721167b39775a44.NginxMailingListEnglish@forum.nginx.org> References: <4D73FB1E.3090104@alokat.org> <3f29c76ca3fec62ea3f4f3423b70de4e.NginxMailingListEnglish@forum.nginx.org> <8599d7049c20a5f08721167b39775a44.NginxMailingListEnglish@forum.nginx.org> Message-ID: <656fc93354f0009fb1ef5831e7369a2a.NginxMailingListEnglish@forum.nginx.org> auth_http script is working fine if i use pop/imap ports 110/143, if i use 993/995 it's not working Posted at Nginx Forum: http://forum.nginx.org/read.php?2,180902,195125#msg-195125 From cedric.jeanneret at camptocamp.com Tue May 3 11:44:48 2011 From: cedric.jeanneret at camptocamp.com (Cedric Jeanneret) Date: Tue, 3 May 2011 09:44:48 +0200 Subject: domain rewrite/redirect In-Reply-To: <7b57cba3f10768842326d51ac87ced5f.NginxMailingListEnglish@forum.nginx.org> References: <9846569c04e02f90d5435cd81c105ee3.NginxMailingListEnglish@forum.nginx.org> <7b57cba3f10768842326d51ac87ced5f.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110503094448.27d397f8@cholatse.wrk.lsn.camptocamp.com> On Mon, 02 May 2011 19:55:11 -0400 "chiefops" wrote: > Nevermind, got if fixed on my end. Simple, just had to reread the wiki: > > rewrite ^ https://abcd.com/referrals$request_uri? permanent; > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,195075,195093#msg-195093 > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx Hello, You may also use HSTS headers to ensure your users use SSL instead of non-SSL. This won't replace the redirect, but the compatible browser will know on the next visit that it should use the SSL server only. It won't request the non-SSL part. More about HSTS: https://secure.wikimedia.org/wikipedia/en/wiki/HTTP_Strict_Transport_Security Cheers, C. -- C?dric Jeanneret | System Administrator 021 619 10 32 | Camptocamp SA cedric.jeanneret at camptocamp.com | PSE-A / EPFL www.camptocamp.com | www.github.com/camptocamp -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From mdounin at mdounin.ru Tue May 3 11:45:07 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 3 May 2011 11:45:07 +0400 Subject: 502 errors, upstream sent too big header In-Reply-To: References: Message-ID: <20110503074507.GL42265@mdounin.ru> Hello! On Tue, May 03, 2011 at 04:03:29AM +0200, Mike P. wrote: > According to passenger's documentation, it doesn't appear that a > directive exists to adjust any header size limitations. > > Also, Phusion's CTO doesn't mention any possible solution here regarding > the same error: http://goo.gl/ZPXvO Ah, indeed: looking though code suggests they unconditionally set buffer size to pagesize and doesn't allow it to be changed. > If there is no such adjustment that can be made via passenger to > alleviate this error, is there also no possible solution within Nginx? You may consider using another module to talk to backends, standard proxy or fastcgi may be a good solution. Maxim Dounin From igor at sysoev.ru Tue May 3 13:10:55 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 3 May 2011 13:10:55 +0400 Subject: Using map and proxy_pass In-Reply-To: <201104301252.43466.markus.jelsma@openindex.io> References: <201104291748.48357.markus.jelsma@openindex.io> <201104301252.43466.markus.jelsma@openindex.io> Message-ID: <20110503091055.GE1707@sysoev.ru> On Sat, Apr 30, 2011 at 12:52:42PM +0200, Markus Jelsma wrote: > Too many. I need to generate the mappings in an external program. I'd rather > not generate as many different locations. Why ? locations without regex will run fast. -- Igor Sysoev From mscherer82 at gmail.com Tue May 3 15:01:53 2011 From: mscherer82 at gmail.com (mscherer82 at gmail.com) Date: Tue, 3 May 2011 13:01:53 +0200 Subject: multiple connections to a fastcgi server Message-ID: Hello, I want to build a fast cgi server application which can handle multiple simoultanous calls. I found the threaded.c (or threaded.pl) example in the fast cgi sdk. (http://www.fastcgi.com/devkit/examples/threaded.c) But when running with my current configuration, the webserver only opens one connection at time and the second requests is waiting until the first one is finished. I don't want to use multiplexing. It could be done through multiple connections. default: server { ... location ~ \.c$ { include /etc/nginx/fastcgi_params; #or whatever you named it # fastcgi_pass unix:/tmp/c.socket; fastcgi_pass 127.0.0.1:9000; } } Is it possible to change this behaviour? Thanks Marc From markus.jelsma at openindex.io Tue May 3 15:02:53 2011 From: markus.jelsma at openindex.io (Markus Jelsma) Date: Tue, 3 May 2011 13:02:53 +0200 Subject: Using map and proxy_pass In-Reply-To: <20110503091055.GE1707@sysoev.ru> References: <201104291748.48357.markus.jelsma@openindex.io> <201104301252.43466.markus.jelsma@openindex.io> <20110503091055.GE1707@sysoev.ru> Message-ID: <201105031302.53844.markus.jelsma@openindex.io> Thanks Francis and Igor. Is there are penalty for having a huge configuration because of a very large number of locations? On Tuesday 03 May 2011 11:10:55 Igor Sysoev wrote: > On Sat, Apr 30, 2011 at 12:52:42PM +0200, Markus Jelsma wrote: > > Too many. I need to generate the mappings in an external program. I'd > > rather not generate as many different locations. > > Why ? locations without regex will run fast. -- Markus Jelsma - CTO - Openindex http://www.linkedin.com/in/markus17 050-8536620 / 06-50258350 From mdounin at mdounin.ru Tue May 3 15:46:42 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 3 May 2011 15:46:42 +0400 Subject: Crash (double free or corruption) on trying to proxy to localhost In-Reply-To: References: <20110502210456.GH42265@mdounin.ru> Message-ID: <20110503114642.GN42265@mdounin.ru> Hello! On Mon, May 02, 2011 at 04:45:13PM -0700, Stephen Weeks wrote: > Sure! I've added it to the post on github. I've slightly edited the log > out of paranoia (replacing a customer ID and auth key). > > I can confirm now that I ran this proxy with the upstreamfair module > overnight and it didn't crash at all. I can't get it to preferentially > serve to localhost, though, as it doesn't support 'backup' as a server > attribute, and doesn't seem to really use the weights, so that's suboptimal. > > Anything else I can add to help troubleshooting this? Anything you'd like > from the core dump? Ok, thank you, it looks like I see the problem. Allocation for "tried" flags doesn't take into account number of backup servers, and if there are more backup servers than normal ones (and backup servers are in fact used) - this may cause memory corruption. Please try the attached patch. Maxim Dounin > > On Mon, May 2, 2011 at 2:04 PM, Maxim Dounin wrote: > > > Hello! > > > > On Sun, May 01, 2011 at 05:54:17PM -0700, Stephen Weeks wrote: > > > > > I've currently got a pool of systems running nginx proxying to a pool of > > > systems running apache. I'm trying to move to running nginx locally on > > the > > > apache hosts instead of separate systems to avoid the extra network hop, > > > make more-efficient use of resources, and enable some future development > > > (including migrating to running our application on nginx via fastcgi > > instead > > > of apache, ideally). we've currently got some significant architecture > > > built up around apache, so converting right now is uncomfortable. > > > > > > Ideally, I'd like nginx to just serve from localhost, but fail over to > > the > > > rest of the pool when localhost in unavailable, so in my upstream I have > > > every server except for localhost set as 'backup'. I'm otherwise running > > > identical configurations of apache and nginx on a single system together > > as > > > used in the rest of the two pools. This works exactly as expected, > > except > > > that I get a few crashes of nginx workers every minute. This only > > happens > > > when proxying to the local system. If I proxy anywhere else, it works > > > fine. Other proxies can serve from this system without trouble. I see > > this > > > same behaviour on other hosts when I build them the same way, so it's not > > an > > > error with the host. I see this crash on 0.7.65, 0.8.54, and 1.0.0, > > running > > > on Ubuntu 10.04 LTS. I see this crash whether I'm connecting to > > 127.0.0.1 > > > or the host's local IP. I see this crash whether I'm listening on *:80 > > or > > > :80. I see this crash whether I'm connecting to :80 or > > running > > > apache on a different port and connecting to :81. I see this crash > > whether > > > I'm running ubuntu's "nginx-light" configuration, or their "nginx-full" > > > configuration. I see no errors logged from apache. > > > > > > 1) I'd really love to make this work, so if there's anything else I can > > try, > > > any additional debugging information I can give, I'd appreciate it. > > > 2) Nginx has been very useful to me so far, so I thought you'd appreciate > > a > > > bug report. > > > > > > Posted on github, I have a problem description, section of a debug log, > > my > > > (slightly edited: flattened includes and stripped an IP) nginx.conf, a > > gdb > > > backtrace, and some additional information I was asked for when looking > > for > > > help on IRC. This is everything I've been able to come up with that > > sounds > > > plausibly relevant. > > > > > > https://gist.github.com/1574dbaf3a3dcda920a2 > > > > > > Any help? > > > > Could you please provide: > > > > 1. nginx -V output > > > > 2. Full debug log for '*60' connection (the one which triggered > > abort in glibc), the one you provided contatins only last part of > > the connection in question. Running grep -F ' 27772#0: *60 ' on > > original debug log should produce something useable. > > > > Maxim Dounin > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://nginx.org/mailman/listinfo/nginx > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx -------------- next part -------------- # HG changeset patch # User Maxim Dounin # Date 1304422854 -14400 # Node ID b7826a837aaf484462db58d64ec0d060ba8b92e5 # Parent 00d13b6d4ebd225f94a2e2a3afa7dbd3ddfe4ed7 Upstream: properly allocate memory for tried flags. Previous allocation only took into account number of non-backup servers, and this caused memory corruption with many backup servers. See report here: http://nginx.org/pipermail/nginx/2011-May/026531.html diff --git a/src/http/ngx_http_upstream_round_robin.c b/src/http/ngx_http_upstream_round_robin.c --- a/src/http/ngx_http_upstream_round_robin.c +++ b/src/http/ngx_http_upstream_round_robin.c @@ -219,13 +219,18 @@ ngx_http_upstream_init_round_robin_peer( rrp->peers = us->peer.data; rrp->current = 0; - if (rrp->peers->number <= 8 * sizeof(uintptr_t)) { + n = rrp->peers->number; + + if (rrp->peers->next && rrp->peers->next->number > n) { + n = rrp->peers->next->number; + } + + if (n <= 8 * sizeof(uintptr_t)) { rrp->tried = &rrp->data; rrp->data = 0; } else { - n = (rrp->peers->number + (8 * sizeof(uintptr_t) - 1)) - / (8 * sizeof(uintptr_t)); + n = (n + (8 * sizeof(uintptr_t) - 1)) / (8 * sizeof(uintptr_t)); rrp->tried = ngx_pcalloc(r->pool, n * sizeof(uintptr_t)); if (rrp->tried == NULL) { From sweeks at imvu.com Tue May 3 16:00:03 2011 From: sweeks at imvu.com (Stephen Weeks) Date: Tue, 3 May 2011 05:00:03 -0700 Subject: Crash (double free or corruption) on trying to proxy to localhost In-Reply-To: <20110503114642.GN42265@mdounin.ru> References: <20110502210456.GH42265@mdounin.ru> <20110503114642.GN42265@mdounin.ru> Message-ID: I should be able to try this out tonight (>12 hours from now). I'll let you know how it works. Thanks for looking into this for me. On Tue, May 3, 2011 at 4:46 AM, Maxim Dounin wrote: > Hello! > > On Mon, May 02, 2011 at 04:45:13PM -0700, Stephen Weeks wrote: > > > Sure! I've added it to the post on github. I've slightly edited the log > > out of paranoia (replacing a customer ID and auth key). > > > > I can confirm now that I ran this proxy with the upstreamfair module > > overnight and it didn't crash at all. I can't get it to preferentially > > serve to localhost, though, as it doesn't support 'backup' as a server > > attribute, and doesn't seem to really use the weights, so that's > suboptimal. > > > > Anything else I can add to help troubleshooting this? Anything you'd > like > > from the core dump? > > Ok, thank you, it looks like I see the problem. > > Allocation for "tried" flags doesn't take into account number of > backup servers, and if there are more backup servers than normal > ones (and backup servers are in fact used) - this may cause memory > corruption. > > Please try the attached patch. > > Maxim Dounin > > > > > On Mon, May 2, 2011 at 2:04 PM, Maxim Dounin wrote: > > > > > Hello! > > > > > > On Sun, May 01, 2011 at 05:54:17PM -0700, Stephen Weeks wrote: > > > > > > > I've currently got a pool of systems running nginx proxying to a pool > of > > > > systems running apache. I'm trying to move to running nginx locally > on > > > the > > > > apache hosts instead of separate systems to avoid the extra network > hop, > > > > make more-efficient use of resources, and enable some future > development > > > > (including migrating to running our application on nginx via fastcgi > > > instead > > > > of apache, ideally). we've currently got some significant > architecture > > > > built up around apache, so converting right now is uncomfortable. > > > > > > > > Ideally, I'd like nginx to just serve from localhost, but fail over > to > > > the > > > > rest of the pool when localhost in unavailable, so in my upstream I > have > > > > every server except for localhost set as 'backup'. I'm otherwise > running > > > > identical configurations of apache and nginx on a single system > together > > > as > > > > used in the rest of the two pools. This works exactly as expected, > > > except > > > > that I get a few crashes of nginx workers every minute. This only > > > happens > > > > when proxying to the local system. If I proxy anywhere else, it > works > > > > fine. Other proxies can serve from this system without trouble. I > see > > > this > > > > same behaviour on other hosts when I build them the same way, so it's > not > > > an > > > > error with the host. I see this crash on 0.7.65, 0.8.54, and 1.0.0, > > > running > > > > on Ubuntu 10.04 LTS. I see this crash whether I'm connecting to > > > 127.0.0.1 > > > > or the host's local IP. I see this crash whether I'm listening on > *:80 > > > or > > > > :80. I see this crash whether I'm connecting to :80 or > > > running > > > > apache on a different port and connecting to :81. I see this crash > > > whether > > > > I'm running ubuntu's "nginx-light" configuration, or their > "nginx-full" > > > > configuration. I see no errors logged from apache. > > > > > > > > 1) I'd really love to make this work, so if there's anything else I > can > > > try, > > > > any additional debugging information I can give, I'd appreciate it. > > > > 2) Nginx has been very useful to me so far, so I thought you'd > appreciate > > > a > > > > bug report. > > > > > > > > Posted on github, I have a problem description, section of a debug > log, > > > my > > > > (slightly edited: flattened includes and stripped an IP) nginx.conf, > a > > > gdb > > > > backtrace, and some additional information I was asked for when > looking > > > for > > > > help on IRC. This is everything I've been able to come up with that > > > sounds > > > > plausibly relevant. > > > > > > > > https://gist.github.com/1574dbaf3a3dcda920a2 > > > > > > > > Any help? > > > > > > Could you please provide: > > > > > > 1. nginx -V output > > > > > > 2. Full debug log for '*60' connection (the one which triggered > > > abort in glibc), the one you provided contatins only last part of > > > the connection in question. Running grep -F ' 27772#0: *60 ' on > > > original debug log should produce something useable. > > > > > > Maxim Dounin > > > > > > _______________________________________________ > > > nginx mailing list > > > nginx at nginx.org > > > http://nginx.org/mailman/listinfo/nginx > > > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://nginx.org/mailman/listinfo/nginx > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor at sysoev.ru Tue May 3 16:06:21 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 3 May 2011 16:06:21 +0400 Subject: Using map and proxy_pass In-Reply-To: <201105031302.53844.markus.jelsma@openindex.io> References: <201104291748.48357.markus.jelsma@openindex.io> <201104301252.43466.markus.jelsma@openindex.io> <20110503091055.GE1707@sysoev.ru> <201105031302.53844.markus.jelsma@openindex.io> Message-ID: <20110503120621.GT1707@sysoev.ru> On Tue, May 03, 2011 at 01:02:53PM +0200, Markus Jelsma wrote: > Thanks Francis and Igor. Is there are penalty for having a huge configuration > because of a very large number of locations? nginx uses some kind of binary tree to search locations, so penalty should be small. -- Igor Sysoev > On Tuesday 03 May 2011 11:10:55 Igor Sysoev wrote: > > On Sat, Apr 30, 2011 at 12:52:42PM +0200, Markus Jelsma wrote: > > > Too many. I need to generate the mappings in an external program. I'd > > > rather not generate as many different locations. > > > > Why ? locations without regex will run fast. > > -- > Markus Jelsma - CTO - Openindex > http://www.linkedin.com/in/markus17 > 050-8536620 / 06-50258350 From igor at sysoev.ru Tue May 3 16:15:58 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 3 May 2011 16:15:58 +0400 Subject: nginx-1.0.1 Message-ID: <20110503121558.GW1707@sysoev.ru> Changes with nginx 1.0.1 03 May 2011 *) Change: now the "split_clients" directive uses MurmurHash2 algorithm because of better distribution. Thanks to Oleg Mamontov. *) Change: now long strings starting with zero are not considered as false values. Thanks to Maxim Dounin. *) Change: now nginx uses a default listen backlog value 511 on Linux. *) Feature: the $upstream_... variables may be used in the SSI and perl modules. *) Bugfix: now nginx limits better disk cache size. Thanks to Oleg Mamontov. *) Bugfix: a segmentation fault might occur while parsing incorrect IPv4 address; the bug had appeared in 0.9.3. Thanks to Maxim Dounin. *) Bugfix: nginx could not be built by gcc 4.6 without --with-debug option. *) Bugfix: nginx could not be built on Solaris 9 and earlier; the bug had appeared in 0.9.3. Thanks to Dagobert Michelsen. *) Bugfix: $request_time variable had invalid values if subrequests were used; the bug had appeared in 0.8.47. Thanks to Igor A. Valcov. -- Igor Sysoev From mdounin at mdounin.ru Tue May 3 16:16:09 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 3 May 2011 16:16:09 +0400 Subject: multiple connections to a fastcgi server In-Reply-To: References: Message-ID: <20110503121608.GQ42265@mdounin.ru> Hello! On Tue, May 03, 2011 at 01:01:53PM +0200, mscherer82 at gmail.com wrote: > I want to build a fast cgi server application which can handle > multiple simoultanous calls. I found the threaded.c (or threaded.pl) > example in the fast cgi sdk. > (http://www.fastcgi.com/devkit/examples/threaded.c) > > But when running with my current configuration, the webserver only > opens one connection at time and the second requests is waiting until > the first one is finished. I don't want to use multiplexing. It could > be done through multiple connections. nginx will open as many connections to fastcgi backend as it has concurrent requests. If you see only one connection at a time - you may want to check fastcgi app and testing tools you are using, probably serialization of requests happens there. Maxim Dounin From igor at sysoev.ru Tue May 3 16:45:03 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 3 May 2011 16:45:03 +0400 Subject: How to get a 404 logged with try_files? In-Reply-To: References: Message-ID: <20110503124503.GZ1707@sysoev.ru> On Mon, May 02, 2011 at 10:22:50AM -0400, monster wrote: > Hi! Just started with Nginx after reading it reached 1.0. > Congratulation! > > I'm trying to get my test site to return a "missing image" icon when an > image is missing, but have a 404 logged so I know I messed up something. > I want to specify the images name without file extensions, in case I > move some from PNG to JPG, or the other way around. My problem is that > try_files doc says last path MUST exist. I would like last path to be > $uri and cause a 404, not a 500. Tried using error_page to convert 500 > to 404, but did not have any effect. Thanks for any advice! > > location ~ ^/img/[^\.]*$ { > try_files $uri.png $uri.jpg $uri.gif $uri; > error_page 500 =404 /img/missing; > } > > location /img/ { > error_page 404 /img/missing; > } > > location = /img/missing { > rewrite .* /img/icon/missing.png; > } location /img/ { error_page 404 /img/icon/missing.png; location ~ ^/img/[^\.]*$ { try_files $uri.png $uri.jpg $uri.gif $uri =404; } } location = /img/icon/missing.png { # nothing } -- Igor Sysoev From nginx-forum at nginx.us Tue May 3 18:24:54 2011 From: nginx-forum at nginx.us (darckos) Date: Tue, 03 May 2011 10:24:54 -0400 Subject: Nginx Slowdown on Solaris In-Reply-To: References: <5b962f75c896719f311e1758cf349b78.NginxMailingListEnglish@forum.nginx.org> <28809a5d0d94cff2d6f534f448399488.NginxMailingListEnglish@forum.nginx.org> Message-ID: <42399eb9b544e9cb55d74d80ca601475.NginxMailingListEnglish@forum.nginx.org> Hello, I just changed my config with option 3 and I feel like my nignx is better now. http://img232.imageshack.us/img232/5369/nginx.png My new config is : worker_processes 24; events { worker_connections 2048; devpoll_events 1; } http { include mime.types; default_type application/octet-stream; output_buffers 2 256k; keepalive_timeout 15; ... } Thanks for your help Posted at Nginx Forum: http://forum.nginx.org/read.php?2,194233,195256#msg-195256 From piotr.sikora at frickle.com Tue May 3 20:16:50 2011 From: piotr.sikora at frickle.com (Piotr Sikora) Date: Tue, 3 May 2011 18:16:50 +0200 Subject: FRiCKLE Labs & yo.se pres. ngx_cache_purge In-Reply-To: <8EB2CC25B0714F8B988CE183AE7BF6C9@Desktop> References: <07864ADE7B1B46B19DA043DF075AD211@nightmare> <8EB2CC25B0714F8B988CE183AE7BF6C9@Desktop> Message-ID: <2FF88DB4047D46DBB6B2CB508533EA85@Desktop> Version 1.3 is now available at: http://labs.frickle.com/nginx_ngx_cache_purge/ GitHub repository is available at: http://github.com/FRiCKLE/ngx_cache_purge/ Changes: 2011-05-03 VERSION 1.3 * Fix compatibility with nginx-1.0.1. Reported by Sergey A. Osokin and Markus Linnala. 2010-08-29 * Fix compatibility with nginx-0.8.0 and versions older than nginx-0.7.60. Best regards, Piotr Sikora < piotr.sikora at frickle.com > From piotr.sikora at frickle.com Tue May 3 21:15:54 2011 From: piotr.sikora at frickle.com (Piotr Sikora) Date: Tue, 3 May 2011 19:15:54 +0200 Subject: FRiCKLE Labs & C2Hosting pres. ngx_slowfs_cache In-Reply-To: <9598C25E2C214D3AB981B7163E0C967A@Desktop> References: <3F594E374AC64662B26C63FDACA6F09F@nightmare><5708F1AFE3324115B1591ACD4EE3775E@nightmare><491198975B004407BC79739160F49616@nightmare> <9598C25E2C214D3AB981B7163E0C967A@Desktop> Message-ID: <59110DA6D3684E28A1471E0452991D85@Desktop> Version 1.6 is now available at: http://labs.frickle.com/nginx_ngx_slowfs_cache/ GitHub repository is available at: http://github.com/FRiCKLE/ngx_slowfs_cache/ Changes: 2011-05-03 VERSION 1.6 * Fix compatibility with nginx-1.0.1. Reported by Sergey A. Osokin. 2011-04-21 * Stop doing sanity checks when module isn't enabled. Reported by Tobi Tamas. Best regards, Piotr Sikora < piotr.sikora at frickle.com > From nginx-forum at nginx.us Tue May 3 21:42:42 2011 From: nginx-forum at nginx.us (art.wu) Date: Tue, 03 May 2011 13:42:42 -0400 Subject: no server response in https Message-ID: I'm running 0.8.53 on QNX Neutrino 6.5.0 with SSL on and the server doesn't respond to the client. Instead it times out, as below. It does work properly with SSL off. Can you provide any suggestions? Thanks. 2011/05/02 09:39:57 [debug] 2220074#0: *7 http check ssl handshake 2011/05/02 09:39:57 [debug] 2220074#0: *7 https ssl handshake: 0x16 2011/05/02 09:39:57 [debug] 2220074#0: *7 SSL_do_handshake: -1 2011/05/02 09:39:57 [debug] 2220074#0: *7 SSL_get_error: 2 2011/05/02 09:39:57 [debug] 2220074#0: *7 post event 080E284C 2011/05/02 09:39:57 [debug] 2220074#0: *7 delete posted event 080E284C 2011/05/02 09:39:57 [debug] 2220074#0: *7 SSL handshake handler: 0 2011/05/02 09:39:57 [debug] 2220074#0: *7 SSL_do_handshake: 1 2011/05/02 09:39:57 [debug] 2220074#0: *7 select del event fd:3 ev:5 2011/05/02 09:39:57 [debug] 2220074#0: *7 SSL: TLSv1, cipher: "DHE-RSA-AES256-SHA SSLv3 Kx=DH Au=RSA Enc=AES(256) Mac=SHA1" 2011/05/02 09:39:57 [debug] 2220074#0: *7 http process request line 2011/05/02 09:39:57 [debug] 2220074#0: *7 SSL_read: -1 2011/05/02 09:39:57 [debug] 2220074#0: *7 SSL_get_error: 2 2011/05/02 09:39:57 [debug] 2220074#0: *7 select add event fd:3 ev:5 2011/05/02 09:39:57 [debug] 2220074#0: *7 post event 080E284C 2011/05/02 09:39:57 [debug] 2220074#0: *7 delete posted event 080E284C 2011/05/02 09:39:57 [debug] 2220074#0: *7 http process request line 2011/05/02 09:39:57 [debug] 2220074#0: *7 SSL_read: 132 2011/05/02 09:39:57 [debug] 2220074#0: *7 SSL_read: -1 2011/05/02 09:39:57 [debug] 2220074#0: *7 SSL_get_error: 2 2011/05/02 09:39:57 [debug] 2220074#0: *7 http request line: "GET / HTTP/1.1" 2011/05/02 09:39:57 [debug] 2220074#0: *7 http uri: "/" 2011/05/02 09:39:57 [debug] 2220074#0: *7 http args: "" 2011/05/02 09:39:57 [debug] 2220074#0: *7 http exten: "" 2011/05/02 09:39:57 [debug] 2220074#0: *7 http process request header line 2011/05/02 09:39:57 [debug] 2220074#0: *7 http header: "User-Agent: curl/7.21.6 (amd64-pc-win32) libcurl/7.21.6 OpenSSL/0.9.8r zlib/1.2.5" 2011/05/02 09:39:57 [debug] 2220074#0: *7 http header: "Host: 10.0.4.237" 2011/05/02 09:39:57 [debug] 2220074#0: *7 http header: "Accept: */*" 2011/05/02 09:39:57 [debug] 2220074#0: *7 http header done 2011/05/02 09:39:57 [debug] 2220074#0: *7 event timer del: 3: 2968566242 2011/05/02 09:39:57 [debug] 2220074#0: *7 rewrite phase: 0 2011/05/02 09:39:57 [debug] 2220074#0: *7 test location: "/" 2011/05/02 09:39:57 [debug] 2220074#0: *7 test location: ~ "\.cgi$" 2011/05/02 09:39:57 [debug] 2220074#0: *7 using configuration "/" 2011/05/02 09:39:57 [debug] 2220074#0: *7 http cl:-1 max:1048576 2011/05/02 09:39:57 [debug] 2220074#0: *7 rewrite phase: 2 2011/05/02 09:39:57 [debug] 2220074#0: *7 post rewrite phase: 3 2011/05/02 09:39:57 [debug] 2220074#0: *7 generic phase: 4 2011/05/02 09:39:57 [debug] 2220074#0: *7 generic phase: 5 2011/05/02 09:39:57 [debug] 2220074#0: *7 access phase: 6 2011/05/02 09:39:57 [debug] 2220074#0: *7 access phase: 7 2011/05/02 09:39:57 [debug] 2220074#0: *7 post access phase: 8 2011/05/02 09:39:57 [debug] 2220074#0: *7 content phase: 9 2011/05/02 09:39:57 [debug] 2220074#0: *7 open index "/www/webdoc/index.html" 2011/05/02 09:39:57 [debug] 2220074#0: *7 internal redirect: "/index.html?" 2011/05/02 09:39:57 [debug] 2220074#0: *7 rewrite phase: 0 2011/05/02 09:39:57 [debug] 2220074#0: *7 test location: "/" 2011/05/02 09:39:57 [debug] 2220074#0: *7 test location: "50x.html" 2011/05/02 09:39:57 [debug] 2220074#0: *7 test location: ~ "\.cgi$" 2011/05/02 09:39:57 [debug] 2220074#0: *7 using configuration "/" 2011/05/02 09:39:57 [debug] 2220074#0: *7 http cl:-1 max:1048576 2011/05/02 09:39:57 [debug] 2220074#0: *7 rewrite phase: 2 2011/05/02 09:39:57 [debug] 2220074#0: *7 post rewrite phase: 3 2011/05/02 09:39:57 [debug] 2220074#0: *7 generic phase: 4 2011/05/02 09:39:57 [debug] 2220074#0: *7 generic phase: 5 2011/05/02 09:39:57 [debug] 2220074#0: *7 access phase: 6 2011/05/02 09:39:57 [debug] 2220074#0: *7 access phase: 7 2011/05/02 09:39:57 [debug] 2220074#0: *7 post access phase: 8 2011/05/02 09:39:57 [debug] 2220074#0: *7 content phase: 9 2011/05/02 09:39:57 [debug] 2220074#0: *7 content phase: 10 2011/05/02 09:39:57 [debug] 2220074#0: *7 content phase: 11 2011/05/02 09:39:57 [debug] 2220074#0: *7 http filename: "/www/webdoc/index.html" 2011/05/02 09:39:57 [debug] 2220074#0: *7 add cleanup: 080F9748 2011/05/02 09:39:57 [debug] 2220074#0: *7 http static fd: 4 2011/05/02 09:39:57 [debug] 2220074#0: *7 http set discard body 2011/05/02 09:39:57 [debug] 2220074#0: *7 HTTP/1.1 200 OK Server: nginx/0.8.53 Date: Mon, 02 May 2011 13:39:57 GMT Content-Type: text/html Content-Length: 5222 Last-Modified: Wed, 27 Apr 2011 20:25:09 GMT Connection: keep-alive Accept-Ranges: bytes 2011/05/02 09:39:57 [debug] 2220074#0: *7 write new buf t:1 f:0 080F981C, pos 080F981C, size: 217 file: 0, size: 0 2011/05/02 09:39:57 [debug] 2220074#0: *7 http write filter: l:0 f:0 s:217 2011/05/02 09:39:57 [debug] 2220074#0: *7 http output filter "/index.html?" 2011/05/02 09:39:57 [debug] 2220074#0: *7 http copy filter: "/index.html?" 2011/05/02 09:39:57 [debug] 2220074#0: *7 malloc: 0814BB80:5222 2011/05/02 09:39:57 [debug] 2220074#0: *7 read: 4, 0814BB80, 5222, 0 2011/05/02 09:39:57 [debug] 2220074#0: *7 http postpone filter "/index.html?" 080F9974 2011/05/02 09:39:57 [debug] 2220074#0: *7 write old buf t:1 f:0 080F981C, pos 080F981C, size: 217 file: 0, size: 0 2011/05/02 09:39:57 [debug] 2220074#0: *7 write new buf t:1 f:0 0814BB80, pos 0814BB80, size: 5222 file: 0, size: 0 2011/05/02 09:39:57 [debug] 2220074#0: *7 http write filter: l:1 f:0 s:5439 2011/05/02 09:39:57 [debug] 2220074#0: *7 http write filter limit 0 2011/05/02 09:39:57 [debug] 2220074#0: *7 posix_memalign: 080E1370:256 @16 2011/05/02 09:39:57 [debug] 2220074#0: *7 malloc: 080FCFF0:16384 2011/05/02 09:39:57 [debug] 2220074#0: *7 http write filter 080F98FC 2011/05/02 09:39:57 [debug] 2220074#0: *7 http copy filter: -2 "/index.html?" 2011/05/02 09:39:57 [debug] 2220074#0: *7 http finalize request: -2, "/index.html?" a:1, c:2 2011/05/02 09:39:57 [debug] 2220074#0: *7 event timer add: 3: 60000:2968566732 2011/05/02 09:39:57 [debug] 2220074#0: *7 http finalize request: -4, "/index.html?" a:1, c:2 2011/05/02 09:39:57 [debug] 2220074#0: *7 http request count:2 blk:0 2011/05/02 09:40:57 [debug] 2220074#0: *7 event timer del: 3: 2968566732 2011/05/02 09:40:57 [debug] 2220074#0: *7 http run request: "/index.html?" 2011/05/02 09:40:57 [debug] 2220074#0: *7 http writer handler: "/index.html?" 2011/05/02 09:40:57 [info] 2220074#0: *7 client timed out (260: Connection timed out) while sending response to client, client: 10.0.4.118, server: tf2000, request: "GET / HTTP/1.1", host: "10.0.4.237" 2011/05/02 09:40:57 [debug] 2220074#0: *7 http finalize request: 408, "/index.html?" a:1, c:1 2011/05/02 09:40:57 [debug] 2220074#0: *7 http terminate request count:1 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,195329,195329#msg-195329 From lists at ruby-forum.com Wed May 4 01:00:52 2011 From: lists at ruby-forum.com (Mike P.) Date: Tue, 03 May 2011 23:00:52 +0200 Subject: 502 errors, upstream sent too big header In-Reply-To: References: Message-ID: <706c3a2663e40773c575d47b54ec69aa@ruby-forum.com> Maxim, Thanks! This makes a lot more sense now. I'll pursue a resolution with passenger at this time. Hopefully this is something that they can eventually resolve with a future release. Mike P. -- Posted via http://www.ruby-forum.com/. From kworthington at gmail.com Wed May 4 06:36:02 2011 From: kworthington at gmail.com (Kevin Worthington) Date: Tue, 3 May 2011 22:36:02 -0400 Subject: Nginx-1.0.1 for Windows 32-bit and 64-bit now available Message-ID: For those interested, Cygwin based versions of Nginx for Windows (both 32-bit and 64-bit) builds are available here: http://www.kevinworthington.com/nginx-for-windows/ Blog post/announcement: http://www.kevinworthington.com/nginx-101-windows/ Cygwin is NOT required on your system to run this version; all needed files are included. Please note that I have been providing Cygwin based builds since before official Windows builds were made available. It's mostly to support folks already using the builds. Thank you, Kevin -- Kevin Worthington http://www.kevinworthington.com/ From agentzh at gmail.com Wed May 4 06:54:08 2011 From: agentzh at gmail.com (agentzh) Date: Wed, 4 May 2011 10:54:08 +0800 Subject: Catch ALL requests by LUA-script In-Reply-To: <90c728b1bd4f045a01171963ba75b30f.NginxMailingListEnglish@forum.nginx.org> References: <90c728b1bd4f045a01171963ba75b30f.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Mon, May 2, 2011 at 12:11 PM, HowToMeetLadies wrote: > Maybe slightly off-topic but then maybe it is useful for you (andiL) or > someone else. > Your feedback is always welcome! Sorry for the delay on my side for I was enjoying my vocation in the Fuzhou city in the southern region of China in the last few days :) > Before i start, @agentzh: every ?nth request, one of nginx > (0.8.54.4rc2-jit2beta6) worker processes segfaults, is this behaviour > related to the pcre issue? have not patched it yet.. ah and thank you > *very* much for giving nginx this all new powers!! ((: > What's your operating system? We used to observe similar periodic segfaults with exactly the same version of ngx_openresty on RedHat Enterprise Linux (RHEL) 5.4 in production but now all is fine after we switched LuaJIT to a more recent git HEAD version which includes an important work-around for an old libgcc bug explained here in the lua-l mailing list: http://lua-users.org/lists/lua-l/2011-03/msg00576.html I'll make a new release of ngx_openresty to include a new version of LuaJIT as well as some other modules' updates like ngx_lua's and ngx_srcache's. I'll inform you here when I'm done. Also, it'll be very appreciated if you can obtain a gdb backtrace for your segfaults so that we can look at the details ;) > Ok, im a long time nginx/redis/ruby user and this are my first steps > with lua and a lightweight (M)VC framework around three core "classes", > which uses haml for templates/layout and markdown for text processing (5 > minute ffi discount binding), drizzle and redis for data and redis also > for caching. Successfully running a little app with it. yay! *.* For now > i can give you some snippets just to show some basic aspects, ill > release a fully working example sometime soon, if the segfaults doesnt > belong to the pcre-issue ill try to debug that too. > Oh, that's awesome :) > > Below ill use luasql, instead you can use > ngx.location.capture("/some-internal-rds-json") and lua-yajl, but this > approach ends as soon as you want INSERT followed by LAST_INSERT_ID() or > other complex queries/transactions (as long as libdrizzle has no support > for multiple queries, maybe this is not the best option to go with, ive > tried alternatives and workarounds, but for now this is what *I* want). > The luasql library will certainly block nginx worker processes. Please dont' use that. I know libdrizzle is very limited in terms of functionality and it's *not* maintained very well. We'll start a completely new nginx upstream modules for mysql named ngx_mysql by implementing a non-blocking full-fledged highly-optimized mysql client from scratch. I'd love to see it happen this year ;) Another direction we're taking is to introduce the "cosocket" mechanism into ngx_lua such that one can use a *synchronous* Lua socket API that is transparently *asynchronous* and *non-blocking* on the nginx C level. Atop that, we can build pure-Lua non-blocking mysql client driver and thus putting everything onto the Lua land and no longer need to mess up the nginx.conf file and nginx subrequests. I'd also want to see it happen by this Christmas ;) > At the moment i do not need an ORM for my data, but have already done > some functions for both rds_json and luasql. redis has some commands > exposed in nginx.conf for easy access with lua (: The core classes: > > Request; which contains several ngx.var wrappers (for nil instead of '' > for empty keys), present(str), simple cookie/session/login, before/after > filters, haml/markdown rendering, etc.. > > MethodRequest < Request; which calls functions for HTTP Methods aka GET, > POST alike.. > and finally Resource < MethodRequest; which has an > Rails-ActionController-like interface. > The high-level abstraction for ngx_lua is excellent! We're taking a slightly different approach along the line in our web applications: http://agentzh.org/misc/nginx/lzsql-manual.html We're using a DSL (Domain Specific Language) compiler that emits Lua code and business logic is mostly implemented in this DSL. It's targeting our business though, not meant to be useful for general web application development (yet). Thanks for sharing! -agentzh From nginx-forum at nginx.us Wed May 4 07:10:53 2011 From: nginx-forum at nginx.us (stalkercn) Date: Tue, 03 May 2011 23:10:53 -0400 Subject: How to avoid "too big header" issue? In-Reply-To: <12c7edea30d035b06c961d149e30db75.NginxMailingListEnglish@forum.nginx.org> References: <12c7edea30d035b06c961d149e30db75.NginxMailingListEnglish@forum.nginx.org> Message-ID: anyone can help me? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,192785,195465#msg-195465 From lists at ruby-forum.com Wed May 4 09:24:37 2011 From: lists at ruby-forum.com (Yanxin Z.) Date: Wed, 04 May 2011 07:24:37 +0200 Subject: limit connection Message-ID: <3eb40128cef9709ed44491c6d10d7e09@ruby-forum.com> Hello, I want to limit the number of connection per hour from IP range. For example, I want to limit every hour, each IP can only visit our website for 5 times. How can I write the config? There is limit_req, which limit the connection rate, used for DDos control. But it is different from my requirement. Thanks, Yanxin -- Posted via http://www.ruby-forum.com/. From caldcv at gmail.com Wed May 4 09:27:57 2011 From: caldcv at gmail.com (Chris) Date: Wed, 4 May 2011 01:27:57 -0400 Subject: limit connection In-Reply-To: <3eb40128cef9709ed44491c6d10d7e09@ruby-forum.com> References: <3eb40128cef9709ed44491c6d10d7e09@ruby-forum.com> Message-ID: You might be better off researching a solution with iptables On 5/4/11, Yanxin Z. wrote: > Hello, > I want to limit the number of connection per hour from IP range. > > For example, I want to limit every hour, each IP can only visit our > website for 5 times. > > How can I write the config? > > There is limit_req, which limit the connection rate, used for DDos > control. > But it is different from my requirement. > > Thanks, > Yanxin > > -- > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -- --C "The dumber people think you are, the more surprised they're going to be when you kill them." - Sir William Clayton From igor at sysoev.ru Wed May 4 10:26:50 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 4 May 2011 10:26:50 +0400 Subject: How to avoid "too big header" issue? In-Reply-To: References: <12c7edea30d035b06c961d149e30db75.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110504062650.GA57647@sysoev.ru> On Tue, May 03, 2011 at 11:10:53PM -0400, stalkercn wrote: > anyone can help me? Could you show "nginx -V" output ? -- Igor Sysoev From igor at sysoev.ru Wed May 4 15:08:17 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 4 May 2011 15:08:17 +0400 Subject: POSIX semaphores patch Message-ID: <20110504110817.GE72381@sysoev.ru> The attache patch enables POSIX semaphores usage during shared memory access. It should decrease CPU usage on start-up or online upgrade of installations with large caches or large number of workers. I tested the patch on FreeBSD 8.2. There is no sense to test it on FreeBSD prior to 7.2 version, since semaphores does not work on these systems. You can ensure that there are enough semaphores: sysctl p1003_1b.sem_nsems_max By default there should be 32 semaphores. On 8.2+ you can increase them dynamically. You need one semaphores per shared zone. "sysctl p1003_1b.nsems" shows current number of semaphores. It would be intresting to test the patch on other platforms - Linux and Solaris. Please draw attention to alerts in error_log. Note also that nginx does not destroy semaphores on exit. They should deleted by kernel automatically. Please check that there is no semaphore leakage while nginx work. -- Igor Sysoev -------------- next part -------------- Index: src/event/ngx_event.c =================================================================== --- src/event/ngx_event.c (revision 3907) +++ src/event/ngx_event.c (working copy) @@ -519,6 +519,7 @@ shared = shm.addr; ngx_accept_mutex_ptr = (ngx_atomic_t *) shared; + ngx_accept_mutex.spin = (ngx_uint_t) -1; if (ngx_shmtx_create(&ngx_accept_mutex, shared, cycle->lock_file.data) != NGX_OK) Index: src/os/unix/ngx_posix_config.h =================================================================== --- src/os/unix/ngx_posix_config.h (revision 3907) +++ src/os/unix/ngx_posix_config.h (working copy) @@ -96,6 +96,11 @@ #include +#if (NGX_HAVE_POSIX_SEM) +#include +#endif + + #if (NGX_HAVE_POLL) #include #endif Index: src/os/unix/ngx_linux_config.h =================================================================== --- src/os/unix/ngx_linux_config.h (revision 3907) +++ src/os/unix/ngx_linux_config.h (working copy) @@ -58,6 +58,11 @@ #include +#if (NGX_HAVE_POSIX_SEM) +#include +#endif + + #if (NGX_HAVE_SYS_PRCTL_H) #include #endif Index: src/os/unix/ngx_freebsd_config.h =================================================================== --- src/os/unix/ngx_freebsd_config.h (revision 3907) +++ src/os/unix/ngx_freebsd_config.h (working copy) @@ -68,6 +68,11 @@ #include +#if (NGX_HAVE_POSIX_SEM) +#include +#endif + + #if (NGX_HAVE_POLL) #include #endif Index: src/os/unix/ngx_solaris_config.h =================================================================== --- src/os/unix/ngx_solaris_config.h (revision 3907) +++ src/os/unix/ngx_solaris_config.h (working copy) @@ -57,6 +57,11 @@ #include +#if (NGX_HAVE_POSIX_SEM) +#include +#endif + + #if (NGX_HAVE_POLL) #include #endif Index: src/os/unix/ngx_darwin_config.h =================================================================== --- src/os/unix/ngx_darwin_config.h (revision 3907) +++ src/os/unix/ngx_darwin_config.h (working copy) @@ -56,6 +56,11 @@ #include +#if (NGX_HAVE_POSIX_SEM) +#include +#endif + + #if (NGX_HAVE_POLL) #include #endif Index: src/core/ngx_shmtx.c =================================================================== --- src/core/ngx_shmtx.c (revision 3907) +++ src/core/ngx_shmtx.c (working copy) @@ -16,9 +16,160 @@ { mtx->lock = addr; + if (mtx->spin == (ngx_uint_t) -1) { + return NGX_OK; + } + + mtx->spin = 2048; + +#if (NGX_HAVE_POSIX_SEM) + + if (sem_init(&mtx->sem, 1, 0) == -1) { + ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, ngx_errno, + "sem_init() failed"); + } else { + mtx->semaphore = 1; + } + +#endif + return NGX_OK; } + +void +ngx_shmtx_destory(ngx_shmtx_t *mtx) +{ +#if (NGX_HAVE_POSIX_SEM) + + if (mtx->semaphore) { + if (sem_destroy(&mtx->sem) == -1) { + ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, ngx_errno, + "sem_destroy() failed"); + } + } + +#endif +} + + +ngx_uint_t +ngx_shmtx_trylock(ngx_shmtx_t *mtx) +{ + ngx_atomic_uint_t val; + + val = *mtx->lock; + + return ((val & 0x80000000) == 0 + && ngx_atomic_cmp_set(mtx->lock, val, val | 0x80000000)); +} + + +void +ngx_shmtx_lock(ngx_shmtx_t *mtx) +{ + ngx_uint_t i, n; + ngx_atomic_uint_t val; + + ngx_log_debug0(NGX_LOG_DEBUG_CORE, ngx_cycle->log, 0, "shmtx lock"); + + for ( ;; ) { + + val = *mtx->lock; + + if ((val & 0x80000000) == 0 + && ngx_atomic_cmp_set(mtx->lock, val, val | 0x80000000)) + { + return; + } + + if (ngx_ncpu > 1) { + + for (n = 1; n < mtx->spin; n <<= 1) { + + for (i = 0; i < n; i++) { + ngx_cpu_pause(); + } + + val = *mtx->lock; + + if ((val & 0x80000000) == 0 + && ngx_atomic_cmp_set(mtx->lock, val, val | 0x80000000)) + { + return; + } + } + } + +#if (NGX_HAVE_POSIX_SEM) + + if (mtx->semaphore) { + val = *mtx->lock; + + if ((val & 0x80000000) + && ngx_atomic_cmp_set(mtx->lock, val, val + 1)) + { + ngx_log_debug1(NGX_LOG_DEBUG_CORE, ngx_cycle->log, 0, + "shmtx wait %XA", val); + + if (sem_wait(&mtx->sem) == -1) { + ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, ngx_errno, + "sem_wait() failed while waiting on shmtx"); + } + + ngx_log_debug0(NGX_LOG_DEBUG_CORE, ngx_cycle->log, 0, + "shmtx awoke"); + + continue; + } + } + +#endif + + ngx_sched_yield(); + } +} + + +void +ngx_shmtx_unlock(ngx_shmtx_t *mtx) +{ + ngx_atomic_uint_t val, old, wait; + + if (mtx->spin != (ngx_uint_t) -1) { + ngx_log_debug0(NGX_LOG_DEBUG_CORE, ngx_cycle->log, 0, "shmtx unlock"); + } + + for ( ;; ) { + + old = *mtx->lock; + wait = old & 0x7fffffff; + val = wait ? wait - 1 : 0; + + if (ngx_atomic_cmp_set(mtx->lock, old, val)) { + break; + } + } + +#if (NGX_HAVE_POSIX_SEM) + { + + if (wait == 0 || !mtx->semaphore) { + return; + } + + ngx_log_debug1(NGX_LOG_DEBUG_CORE, ngx_cycle->log, 0, + "shmtx wake %XA", old); + + if (sem_post(&mtx->sem) == -1) { + ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, ngx_errno, + "sem_post() failed while wake shmtx"); + } + } +#endif +} + + #else @@ -65,4 +216,62 @@ } +ngx_uint_t +ngx_shmtx_trylock(ngx_shmtx_t *mtx) +{ + ngx_err_t err; + + err = ngx_trylock_fd(mtx->fd); + + if (err == 0) { + return 1; + } + + if (err == NGX_EAGAIN) { + return 0; + } + +#if __osf__ /* Tru64 UNIX */ + + if (err == NGX_EACCESS) { + return 0; + } + #endif + + ngx_log_abort(err, ngx_trylock_fd_n " %s failed", mtx->name); + + return 0; +} + + +void +ngx_shmtx_lock(ngx_shmtx_t *mtx) +{ + ngx_err_t err; + + err = ngx_lock_fd(mtx->fd); + + if (err == 0) { + return; + } + + ngx_log_abort(err, ngx_lock_fd_n " %s failed", mtx->name); +} + + +void +ngx_shmtx_unlock(ngx_shmtx_t *mtx) +{ + ngx_err_t err; + + err = ngx_unlock_fd(mtx->fd); + + if (err == 0) { + return; + } + + ngx_log_abort(err, ngx_unlock_fd_n " %s failed", mtx->name); +} + +#endif Index: src/core/ngx_shmtx.h =================================================================== --- src/core/ngx_shmtx.h (revision 3907) +++ src/core/ngx_shmtx.h (working copy) @@ -15,95 +15,23 @@ typedef struct { #if (NGX_HAVE_ATOMIC_OPS) ngx_atomic_t *lock; +#if (NGX_HAVE_POSIX_SEM) + ngx_uint_t semaphore; + sem_t sem; +#endif #else ngx_fd_t fd; u_char *name; #endif + ngx_uint_t spin; } ngx_shmtx_t; ngx_int_t ngx_shmtx_create(ngx_shmtx_t *mtx, void *addr, u_char *name); - - -#if (NGX_HAVE_ATOMIC_OPS) - -static ngx_inline ngx_uint_t -ngx_shmtx_trylock(ngx_shmtx_t *mtx) -{ - return (*mtx->lock == 0 && ngx_atomic_cmp_set(mtx->lock, 0, ngx_pid)); -} - -#define ngx_shmtx_lock(mtx) ngx_spinlock((mtx)->lock, ngx_pid, 1024) - -#define ngx_shmtx_unlock(mtx) (void) ngx_atomic_cmp_set((mtx)->lock, ngx_pid, 0) - -#define ngx_shmtx_destory(mtx) - - -#else - -static ngx_inline ngx_uint_t -ngx_shmtx_trylock(ngx_shmtx_t *mtx) -{ - ngx_err_t err; - - err = ngx_trylock_fd(mtx->fd); - - if (err == 0) { - return 1; - } - - if (err == NGX_EAGAIN) { - return 0; - } - -#if __osf__ /* Tru64 UNIX */ - - if (err == NGX_EACCESS) { - return 0; - } - -#endif - - ngx_log_abort(err, ngx_trylock_fd_n " %s failed", mtx->name); - - return 0; -} - - -static ngx_inline void -ngx_shmtx_lock(ngx_shmtx_t *mtx) -{ - ngx_err_t err; - - err = ngx_lock_fd(mtx->fd); - - if (err == 0) { - return; - } - - ngx_log_abort(err, ngx_lock_fd_n " %s failed", mtx->name); -} - - -static ngx_inline void -ngx_shmtx_unlock(ngx_shmtx_t *mtx) -{ - ngx_err_t err; - - err = ngx_unlock_fd(mtx->fd); - - if (err == 0) { - return; - } - - ngx_log_abort(err, ngx_unlock_fd_n " %s failed", mtx->name); -} - - void ngx_shmtx_destory(ngx_shmtx_t *mtx); +ngx_uint_t ngx_shmtx_trylock(ngx_shmtx_t *mtx); +void ngx_shmtx_lock(ngx_shmtx_t *mtx); +void ngx_shmtx_unlock(ngx_shmtx_t *mtx); -#endif - #endif /* _NGX_SHMTX_H_INCLUDED_ */ Index: auto/os/freebsd =================================================================== --- auto/os/freebsd (revision 3907) +++ auto/os/freebsd (working copy) @@ -49,7 +49,16 @@ have=NGX_HAVE_AIO_SENDFILE . auto/have fi +# POSIX semaphores +# http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/127545 +if [ $osreldate -ge 701106 ]; then + echo " + POSIX semaphores should work" +else + have=NGX_HAVE_POSIX_SEM . auto/nohave +fi + + # kqueue if [ \( $osreldate -lt 500000 -a $osreldate -ge 410000 \) \ Index: auto/unix =================================================================== --- auto/unix (revision 3907) +++ auto/unix (working copy) @@ -234,6 +234,18 @@ . auto/feature +ngx_feature="POSIX semaphores" +ngx_feature_name="NGX_HAVE_POSIX_SEM" +ngx_feature_run=yes +ngx_feature_incs="#include " +ngx_feature_path= +ngx_feature_libs= +ngx_feature_test="sem_t sem; + if (sem_init(&sem, 1, 0) == -1) return 1; + sem_destroy(&sem);" +. auto/feature + + ngx_feature="struct msghdr.msg_control" ngx_feature_name="NGX_HAVE_MSGHDR_MSG_CONTROL" ngx_feature_run=no From nginx-forum at nginx.us Wed May 4 15:09:21 2011 From: nginx-forum at nginx.us (burn) Date: Wed, 04 May 2011 07:09:21 -0400 Subject: not working without aio Message-ID: If you install nginx compiled with aio support on non-aio enabled kernel, it doesn't work: 2011/04/15 11:46:25 [emerg] 18942#0: io_setup() failed (1: Operation not permitted) 2011/04/15 11:46:25 [alert] 18938#0: worker process 18942 exited with fatal code 2 and can not be respawn All workers die, only master process remains, requests aren't served Posted at Nginx Forum: http://forum.nginx.org/read.php?2,195522,195522#msg-195522 From kgorlo at gmail.com Wed May 4 15:25:38 2011 From: kgorlo at gmail.com (Kamil Gorlo) Date: Wed, 4 May 2011 13:25:38 +0200 Subject: Load balancing based on part of url or header Message-ID: Hi guys, is this possible to have similar feature as ip_hash but not based on IP address but on some part of request url (or header)? Cheers, -- Kamil Gorlo From mdounin at mdounin.ru Wed May 4 15:27:33 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 4 May 2011 15:27:33 +0400 Subject: not working without aio In-Reply-To: References: Message-ID: <20110504112733.GT42265@mdounin.ru> Hello! On Wed, May 04, 2011 at 07:09:21AM -0400, burn wrote: > If you install nginx compiled with aio support on non-aio enabled > kernel, it doesn't work: > > 2011/04/15 11:46:25 [emerg] 18942#0: io_setup() failed (1: Operation not > permitted) > 2011/04/15 11:46:25 [alert] 18938#0: worker process 18942 exited with > fatal code 2 and can not be respawn > > All workers die, only master process remains, requests aren't served You have to recompile nginx without aio. Run-time fallback isn't currently supported. Maxim Dounin From mdounin at mdounin.ru Wed May 4 15:28:29 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 4 May 2011 15:28:29 +0400 Subject: Load balancing based on part of url or header In-Reply-To: References: Message-ID: <20110504112828.GU42265@mdounin.ru> Hello! On Wed, May 04, 2011 at 01:25:38PM +0200, Kamil Gorlo wrote: > Hi guys, > > is this possible to have similar feature as ip_hash but not based on > IP address but on some part of request url (or header)? There are 3rd party modules available which do this, check wiki. Maxim Dounin From lists at ruby-forum.com Wed May 4 19:38:56 2011 From: lists at ruby-forum.com (Yanxin Z.) Date: Wed, 04 May 2011 17:38:56 +0200 Subject: limit connection In-Reply-To: <3eb40128cef9709ed44491c6d10d7e09@ruby-forum.com> References: <3eb40128cef9709ed44491c6d10d7e09@ruby-forum.com> Message-ID: Thanks Chris. Do you have example I can refer? Yanxin -- Posted via http://www.ruby-forum.com/. From caldcv at gmail.com Wed May 4 20:36:39 2011 From: caldcv at gmail.com (Chris) Date: Wed, 4 May 2011 12:36:39 -0400 Subject: limit connection In-Reply-To: References: <3eb40128cef9709ed44491c6d10d7e09@ruby-forum.com> Message-ID: Many are available online in regards to SSH limiting however you have to put in IP ranges of people you do not want to limit, which could be very hard. What exactly are you trying to do? On 5/4/11, Yanxin Z. wrote: > Thanks Chris. > Do you have example I can refer? > Yanxin > > -- > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -- --C "The dumber people think you are, the more surprised they're going to be when you kill them." - Sir William Clayton From clanherb at gmail.com Wed May 4 22:59:21 2011 From: clanherb at gmail.com (=?UTF-8?B?5p2o6ZWt?=) Date: Thu, 5 May 2011 02:59:21 +0800 Subject: question about the context of map directive Message-ID: Hi, The context of map directive is *http* as documented on wiki.nginx.org. This means all the requests will go through the map filter phase. This is not ideal when you have many virtual hosts. For example, we've 50+ virtual hosts. When one of them need map variables, the others automatically inherited those settings because there is no way to limit it to server context. If this is the situation, can someone know the internals of nginx explain why the map module can't work at server level. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Brian.Akins at turner.com Wed May 4 23:03:33 2011 From: Brian.Akins at turner.com (Akins, Brian) Date: Wed, 04 May 2011 15:03:33 -0400 Subject: Lua pcre inside nginx Message-ID: I wanted to use pcre inside a lua script using rex_pcre. However, I always get the error: failed to get memory (pattern offset: 15) The snippet of code always works in a standalone script. Ideas? -- Brian Akins From igor at sysoev.ru Wed May 4 23:10:00 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 4 May 2011 23:10:00 +0400 Subject: question about the context of map directive In-Reply-To: References: Message-ID: <20110504191000.GA96440@sysoev.ru> On Thu, May 05, 2011 at 02:59:21AM +0800, ?? wrote: > Hi, > > The context of map directive is *http* as documented on wiki.nginx.org. This > means all the requests will go through the map filter phase. > This is not ideal when you have many virtual hosts. > > For example, we've 50+ virtual hosts. When one of them need map variables, > the others automatically inherited those settings because there is no way to > limit it to server context. > > If this is the situation, can someone know the internals of nginx explain > why the map module can't work at server level. > Thanks. The most nginx directives are declarative. This means that nginx looks up a map only when it needs a variable value defined via the map. There are directives that are really executed: "rewrite" and "if". Avoid them. -- Igor Sysoev From nginx-forum at nginx.us Wed May 4 23:10:38 2011 From: nginx-forum at nginx.us (art.wu) Date: Wed, 04 May 2011 15:10:38 -0400 Subject: no server response in https In-Reply-To: References: Message-ID: <0338c925ce50fa5f3695412caf42853a.NginxMailingListEnglish@forum.nginx.org> There was no response from the server (no 408 received by client). Thanks for your help. config: user nginx nginx; worker_processes 1; events { worker_connections 256; } http { include /usr/pkg/etc/nginx/mime.types; default_type application/octet-stream; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log debug; sendfile on; keepalive_timeout 65; # HTTPS server # server { listen 443; server_name tf2000; ssl on; ssl_certificate /x509/server.crt; ssl_certificate_key /x509/server.key; ssl_session_timeout 5m; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; ssl_prefer_server_ciphers on; location / { root /www/webdoc; index index.html index.htm; } } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,195329,195629#msg-195629 From igor at sysoev.ru Wed May 4 23:15:22 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 4 May 2011 23:15:22 +0400 Subject: question about the context of map directive In-Reply-To: <20110504191000.GA96440@sysoev.ru> References: <20110504191000.GA96440@sysoev.ru> Message-ID: <20110504191522.GC96440@sysoev.ru> On Wed, May 04, 2011 at 11:10:00PM +0400, Igor Sysoev wrote: > On Thu, May 05, 2011 at 02:59:21AM +0800, ?? wrote: > > Hi, > > > > The context of map directive is *http* as documented on wiki.nginx.org. This > > means all the requests will go through the map filter phase. > > This is not ideal when you have many virtual hosts. > > > > For example, we've 50+ virtual hosts. When one of them need map variables, > > the others automatically inherited those settings because there is no way to > > limit it to server context. > > > > If this is the situation, can someone know the internals of nginx explain > > why the map module can't work at server level. > > Thanks. > > The most nginx directives are declarative. This means that nginx > looks up a map only when it needs a variable value defined via the map. > There are directives that are really executed: "rewrite" and "if". > Avoid them. Also "set" and "break". -- Igor Sysoev From mdounin at mdounin.ru Thu May 5 00:35:47 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 5 May 2011 00:35:47 +0400 Subject: question about the context of map directive In-Reply-To: References: Message-ID: <20110504203547.GX42265@mdounin.ru> Hello! On Thu, May 05, 2011 at 02:59:21AM +0800, ?? wrote: > Hi, > > The context of map directive is *http* as documented on wiki.nginx.org. This Yes. > means all the requests will go through the map filter phase. No. Map directive creates a variable and only does something when (and if) the variable is accessed. There is no performance penalty for processing requests which doesn't use the variable. > This is not ideal when you have many virtual hosts. > > For example, we've 50+ virtual hosts. When one of them need map variables, > the others automatically inherited those settings because there is no way to > limit it to server context. > > If this is the situation, can someone know the internals of nginx explain > why the map module can't work at server level. Changing map module to provide data based on per-server configs is possible, but obviously will require extra code. Maxim Dounin From pasik at iki.fi Thu May 5 01:15:50 2011 From: pasik at iki.fi (Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?=) Date: Thu, 5 May 2011 00:15:50 +0300 Subject: nginx proxying do not locally save/buffer uploaded files? Message-ID: <20110504211549.GL32595@reaktio.net> Hello, I'm running nginx as a proxy in front of some backend servers, and while uploading files (HTTP PUT) nginx seems to buffer the files to local disk. This is not a possible method for this setup, because some of the files are so big that they won't fit to the local disk of the nginx box. Is there an option to disable this behaviour? I'd like to directly stream the uploads to the backend.. Thanks, -- Pasi From nginx-forum at nginx.us Thu May 5 01:35:54 2011 From: nginx-forum at nginx.us (jjjx128) Date: Wed, 04 May 2011 17:35:54 -0400 Subject: nginx proxying do not locally save/buffer uploaded files? In-Reply-To: <20110504211549.GL32595@reaktio.net> References: <20110504211549.GL32595@reaktio.net> Message-ID: <153c3efe1bd09d636dcea83de2eb5706.NginxMailingListEnglish@forum.nginx.org> Pasi K?rkk?inen Wrote: ------------------------------------------------------- > Is there an option to disable this behaviour? > I'd like to directly stream the uploads to the > backend.. No. Nginx has no way of streaming data directly to the backend. Take a look at haproxy or any other tcp load balancer. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,195656,195659#msg-195659 From ngx.eugaia at gmail.com Thu May 5 01:37:11 2011 From: ngx.eugaia at gmail.com (Eugaia) Date: Thu, 05 May 2011 00:37:11 +0300 Subject: Lua pcre inside nginx In-Reply-To: References: Message-ID: <4DC1C707.1000705@gmail.com> Hi, On 04/05/2011 22:03, Akins, Brian wrote: > I wanted to use pcre inside a lua script using rex_pcre. However, I always > get the error: > > failed to get memory (pattern offset: 15) > > The snippet of code always works in a standalone script. > > Ideas? I just tried the supplied test suite for rex_pcre on the latest (as of a few days ago) trunk version of LuaJIT 2.0 on Nginx 1.0.0 and there were no test failures. Maybe try JIT if you're not using it already? Cheers, Marcus. From Brian.Akins at turner.com Thu May 5 01:39:52 2011 From: Brian.Akins at turner.com (Akins, Brian) Date: Wed, 04 May 2011 17:39:52 -0400 Subject: Lua pcre inside nginx In-Reply-To: <4DC1C707.1000705@gmail.com> Message-ID: On 5/4/11 5:37 PM, "Eugaia" wrote: > I just tried the supplied test suite for rex_pcre on the latest (as of a > few days ago) trunk version of LuaJIT 2.0 on Nginx 1.0.0 and there were > no test failures. Maybe try JIT if you're not using it already? > I already am using luajit. I was using rex_pcre from luarocks. -- Brian Akins From pasik at iki.fi Thu May 5 01:40:05 2011 From: pasik at iki.fi (Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?=) Date: Thu, 5 May 2011 00:40:05 +0300 Subject: nginx proxying do not locally save/buffer uploaded files? In-Reply-To: <153c3efe1bd09d636dcea83de2eb5706.NginxMailingListEnglish@forum.nginx.org> References: <20110504211549.GL32595@reaktio.net> <153c3efe1bd09d636dcea83de2eb5706.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110504214005.GM32595@reaktio.net> On Wed, May 04, 2011 at 05:35:54PM -0400, jjjx128 wrote: > Pasi K?rkk?inen Wrote: > ------------------------------------------------------- > > Is there an option to disable this behaviour? > > I'd like to directly stream the uploads to the > > backend.. > > No. Nginx has no way of streaming data directly to the backend. Take a > look at haproxy or any other tcp load balancer. > in tcp mode you can't filter the requests etc.. I need to do that aswell. Maybe I need to take a look at the code and try to figure out if direct upload streaming could be implemented in nginx.. Thanks, -- Pasi From nginx-forum at nginx.us Thu May 5 01:56:43 2011 From: nginx-forum at nginx.us (jjjx128) Date: Wed, 04 May 2011 17:56:43 -0400 Subject: nginx proxying do not locally save/buffer uploaded files? In-Reply-To: <20110504214005.GM32595@reaktio.net> References: <20110504214005.GM32595@reaktio.net> Message-ID: <3dfd6d89a78e3ee124ed58524312dada.NginxMailingListEnglish@forum.nginx.org> Pasi K?rkk?inen Wrote: ------------------------------------------------------- > in tcp mode you can't filter the requests etc.. I > need to do that aswell. There are quite a few load balancers and proxies out there. I'm sure you can find something useful. > Maybe I need to take a look at the code and try to > figure out > if direct upload streaming could be implemented in > nginx.. It is possible. So, good luck I guess. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,195656,195665#msg-195665 From Brian.Akins at turner.com Thu May 5 02:11:07 2011 From: Brian.Akins at turner.com (Akins, Brian) Date: Wed, 04 May 2011 18:11:07 -0400 Subject: Lua pcre inside nginx In-Reply-To: Message-ID: On 5/4/11 5:39 PM, "Brian Akins" wrote: > I already am using luajit. I was using rex_pcre from luarocks. I grabbed latest rex_pcre, same issue. This is x86_64 if that matters. -- Brian Akins From lists at ruby-forum.com Thu May 5 02:21:08 2011 From: lists at ruby-forum.com (Yanxin Z.) Date: Thu, 05 May 2011 00:21:08 +0200 Subject: limit connection In-Reply-To: <3eb40128cef9709ed44491c6d10d7e09@ruby-forum.com> References: <3eb40128cef9709ed44491c6d10d7e09@ruby-forum.com> Message-ID: Hi Chris, I want to control the public to do query inside my website, so that bad guy can not do database harvest. For example, each IP can only do query 10 times per day. The IP I do not want to limit is my own IP. So it's simple to recognize the IP range. Please let me know your opinion. Thanks, Yanxin -- Posted via http://www.ruby-forum.com/. From caldcv at gmail.com Thu May 5 02:25:19 2011 From: caldcv at gmail.com (Chris) Date: Wed, 4 May 2011 18:25:19 -0400 Subject: limit connection In-Reply-To: References: <3eb40128cef9709ed44491c6d10d7e09@ruby-forum.com> Message-ID: http://www.shanestillwell.com/blog/2009/03/24/throttle-traffic-iptables I wish you luck on a solution but it seems rather odd On 5/4/11, Yanxin Z. wrote: > Hi Chris, > I want to control the public to do query inside my website, so that bad > guy can not do database harvest. > For example, each IP can only do query 10 times per day. > > The IP I do not want to limit is my own IP. So it's simple to recognize > the IP range. > > Please let me know your opinion. > Thanks, > Yanxin > > -- > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -- --C "The dumber people think you are, the more surprised they're going to be when you kill them." - Sir William Clayton From nginx-forum at nginx.us Thu May 5 04:05:17 2011 From: nginx-forum at nginx.us (HowToMeetLadies) Date: Wed, 04 May 2011 20:05:17 -0400 Subject: Catch ALL requests by LUA-script In-Reply-To: References: Message-ID: <962ffeb780843553c1f353008459a93f.NginxMailingListEnglish@forum.nginx.org> > > Your feedback is always welcome! Sorry for the > delay on my side for I > was enjoying my vocation in the Fuzhou city in the > southern region of > China in the last few days :) > Heh, I know what delays are and that was no delay.. Here it is best weather for bicycling, so i do all the time! ;) One thing on my todo is to visit china, my cousin lived there past 5-6 years and i've seen many pictures and videos.. Last month he married his wife there, but i could not get away :( > > What's your operating system? We used to observe > similar periodic > segfaults with exactly the same version of > ngx_openresty on RedHat > Enterprise Linux (RHEL) 5.4 in production but now My good *old* development box is a quad *i686* with deb5 (old)stable gcc 4.3.2-1.1 > all is fine after we > switched LuaJIT to a more recent git HEAD version > which includes an > important work-around for an old libgcc bug > explained here in the > lua-l mailing list: > > > http://lua-users.org/lists/lua-l/2011-03/msg00576. > html > Tried both samples and luajit detected it. Anyway thank you for sharing this, so ill try that next. > I'll make a new release of ngx_openresty to > include a new version of > LuaJIT as well as some other modules' updates like > ngx_lua's and > ngx_srcache's. I'll inform you here when I'm done. > > Also, it'll be very appreciated if you can obtain > a gdb backtrace for > your segfaults so that we can look at the details > ;) Sure, thats no problem. Tomorrow ill attach to it and take a sample for you. Have also a full dump, as every build has its own /prefix. > > Oh, that's awesome :) > Thanks, but yours is *epic*. > > > > Below ill use luasql, instead you can use > > ngx.location.capture("/some-internal-rds-json") > and lua-yajl, but this > > approach ends as soon as you want INSERT > followed by LAST_INSERT_ID() or > > other complex queries/transactions (as long as > libdrizzle has no support > > for multiple queries, maybe this is not the best > option to go with, ive > > tried alternatives and workarounds, but for now > this is what *I* want). > > > > The luasql library will certainly block nginx > worker processes. Please > dont' use that. > Tbh, youre absolutely right. Realized it before i used this and *I* had no problems, also do not have much inserts (about 25-40k text each, stored in a fraction of a second). Tested it also further with luasql all queries, no problems so far but only with circumventions and all under pre-calculated conditions with *enough* instances, fast i/o, caching etc. This is at no will a reliable solution and much likely a show-stopper! So do *not* try at home eh?!! In the meantime or maybe forever ill stick to redis only (: Exchanges to or from intermediates are stressing me, but still better as seeing ruby eating up resources and doing "nothing" on ngx_passenger/ree.. sinatra, merb, rails, foo, bla -.-" Redis helped there a lot, but even in my *experimental* Rack written with D ive done better! ;) But thats true another story.. As a last resort for mysql i thought of getting an unique id from a (lua) location which is then used for insertion and afterwards on success, i.e. for redirects. Or have i missed something, what would you do? > I know libdrizzle is very limited in terms of > functionality and it's > *not* maintained very well. We'll start a > completely new nginx > upstream modules for mysql named ngx_mysql by > implementing a > non-blocking full-fledged highly-optimized mysql > client from scratch. > I'd love to see it happen this year ;) > > Another direction we're taking is to introduce the > "cosocket" > mechanism into ngx_lua such that one can use a > *synchronous* Lua > socket API that is transparently *asynchronous* > and *non-blocking* on > the nginx C level. Atop that, we can build > pure-Lua non-blocking mysql > client driver and thus putting everything onto the > Lua land and no > longer need to mess up the nginx.conf file and > nginx subrequests. I'd > also want to see it happen by this Christmas ;) > You mentioned "cosocket" somewhere (github?) already and IMO that would be really amazing! I'm following "agentzh" and "chaoslawful" on github and will take a deeper look when i get more time. Will be linking to your projects when i release something useful (safe) for it. > > The high-level abstraction for ngx_lua is > excellent! We're taking a > slightly different approach along the line in our > web applications: > > > http://agentzh.org/misc/nginx/lzsql-manual.html > > We're using a DSL (Domain Specific Language) > compiler that emits Lua > code and business logic is mostly implemented in > this DSL. It's > targeting our business though, not meant to be > useful for general web > application development (yet). > Looks very promising, i seen that page already on my researches and would love to get my hands on it. I do a lot of research, trying as much as possible, protocols like XMPP and PSYC and such good things, but mostly everything apart from PHP, .Net and Java.. :> > Thanks for sharing! > > -agentzh > Heh. >.< All the thanks belong to you and who else is also behind that projects! Had so much *fun* with it so far, you wont believe it how it boosted everything at our groups site, ookeh not *that* much, but enough to already left ruby (was riding since little rails). And personally it helped me alot to grok lua, as i needed that for deeper reworks of my prosody-im fork (another lua project thats awesome, i prefer it over ejabberd/erl which indeed is both neat feature-wise, but wont let me change (easily) from mnesia to redis or other nice tricks). Thanks again! # HTML Posted at Nginx Forum: http://forum.nginx.org/read.php?2,179364,195682#msg-195682 From clanherb at gmail.com Thu May 5 06:14:55 2011 From: clanherb at gmail.com (=?UTF-8?B?5p2o6ZWt?=) Date: Thu, 5 May 2011 10:14:55 +0800 Subject: question about the context of map directive In-Reply-To: <20110504203547.GX42265@mdounin.ru> References: <20110504203547.GX42265@mdounin.ru> Message-ID: Hi Igor and Maxim, Thanks for the reply! On Thu, May 5, 2011 at 4:35 AM, Maxim Dounin wrote: > Hello! > > On Thu, May 05, 2011 at 02:59:21AM +0800, ?? wrote: > > > Hi, > > > > The context of map directive is *http* as documented on wiki.nginx.org. > This > > Yes. > > > means all the requests will go through the map filter phase. > > No. Map directive creates a variable and only does something when > (and if) the variable is accessed. There is no performance > penalty for processing requests which doesn't use the variable. > > > This is not ideal when you have many virtual hosts. > > > > For example, we've 50+ virtual hosts. When one of them need map > variables, > > the others automatically inherited those settings because there is no way > to > > limit it to server context. > > > > If this is the situation, can someone know the internals of nginx explain > > why the map module can't work at server level. > > Changing map module to provide data based on per-server configs is > possible, but obviously will require extra code. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Thu May 5 06:27:50 2011 From: lists at ruby-forum.com (Yanxin Z.) Date: Thu, 05 May 2011 04:27:50 +0200 Subject: limit connection In-Reply-To: <3eb40128cef9709ed44491c6d10d7e09@ruby-forum.com> References: <3eb40128cef9709ed44491c6d10d7e09@ruby-forum.com> Message-ID: <05c99fd96704fbea856c6e5e906fb1ec@ruby-forum.com> Thank you for your direction, Chris. -- Posted via http://www.ruby-forum.com/. From nginx-forum at nginx.us Thu May 5 06:50:07 2011 From: nginx-forum at nginx.us (stalkercn) Date: Wed, 04 May 2011 22:50:07 -0400 Subject: How to avoid "too big header" issue? In-Reply-To: <12c7edea30d035b06c961d149e30db75.NginxMailingListEnglish@forum.nginx.org> References: <12c7edea30d035b06c961d149e30db75.NginxMailingListEnglish@forum.nginx.org> Message-ID: <65b155ed9ec7350b8df7cf617867f95e.NginxMailingListEnglish@forum.nginx.org> nginx version: nginx/0.8.54 configure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt='-I /usr/local/include' --with-ld-opt='-L /usr/local/lib' --conf-path=/usr/local/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx-error.log --user=www --group=www --with-debug --http-client-body-temp-path=/var/tmp/nginx/client_body_temp --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp --http-proxy-temp-path=/var/tmp/nginx/proxy_temp --http-scgi-temp-path=/var/tmp/nginx/scgi_temp --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp --http-log-path=/var/log/nginx-access.log --add-module=/usr/ports/www/nginx/work/ngx_headers_more_module-0.14 --with-http_flv_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_stub_status_module --with-pcre Posted at Nginx Forum: http://forum.nginx.org/read.php?2,192785,195695#msg-195695 From nginx-forum at nginx.us Thu May 5 07:00:14 2011 From: nginx-forum at nginx.us (burn) Date: Wed, 04 May 2011 23:00:14 -0400 Subject: not working without aio In-Reply-To: <20110504112733.GT42265@mdounin.ru> References: <20110504112733.GT42265@mdounin.ru> Message-ID: <3bf60e8194f645c340689fb77744f521.NginxMailingListEnglish@forum.nginx.org> well, then please consider this a feature request. Having two separate packages for our server farm is not too convenient. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,195522,195696#msg-195696 From agentzh at gmail.com Thu May 5 07:20:32 2011 From: agentzh at gmail.com (agentzh) Date: Thu, 5 May 2011 11:20:32 +0800 Subject: Catch ALL requests by LUA-script In-Reply-To: <962ffeb780843553c1f353008459a93f.NginxMailingListEnglish@forum.nginx.org> References: <962ffeb780843553c1f353008459a93f.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Thu, May 5, 2011 at 8:05 AM, HowToMeetLadies wrote: > > Heh, I know what delays are and that was no delay.. Here it is best > weather for bicycling, so i do all the time! ;) One thing on my todo is > to visit china, my cousin lived there past 5-6 years and i've seen many > pictures and videos.. Last month he married his wife there, but i could > not get away :( > Oh, I'm so happy to hear that ;) Please bring my best wishes to your cousin! > > Sure, thats no problem. Tomorrow ill attach to it and take a sample for > you. Have also a full dump, as every build has its own /prefix. > Looking forward to that :) > > Tbh, youre absolutely right. Realized it before i used this and *I* had > no problems, also do not have much inserts (about 25-40k text each, > stored in a fraction of a second). Tested it also further with luasql > all queries, no problems so far but only with circumventions and all > under pre-calculated conditions with *enough* instances, fast i/o, > caching etc. This is at no will a reliable solution and much likely a > show-stopper! So do *not* try at home eh?!! > Well, it will only cause problems when you have too few nginx workers and nontrivial number of concurrent requests and your database is going mad and becoming slow ;) Anyway, it's good for personal use, not for production apps ;) > In the meantime or maybe forever ill stick to redis only (: Exchanges to > or from intermediates are stressing me, but still better as seeing ruby > eating up resources and doing "nothing" on ngx_passenger/ree.. sinatra, > merb, rails, foo, bla -.-" Redis helped there a lot, but even in my > *experimental* Rack written with D ive done better! ;) But thats true > another story.. > When you're using ngx_redis2 + lua-redis-parser, please ensure you're using a tcp connection pool (provided by ngx_http_upstream_keepalive) and redis pipelining wherever possible. These features will significantly improve performance. Also, using multiple instance of redis servers on your multi-core machines also help a lot due to the sequential processing nature of a single redis server instance. Also, when you're benchmarking performance, please ensure that your error log level is high enough to prevent nginx workers spend too much cycles on flushing the error.log file, which is certainly very expensive :) > As a last resort for mysql i thought of getting an unique id from a > (lua) location which is then used for insertion and afterwards on > success, i.e. for redirects. Or have i missed something, what would you > do? > You can certainly generate a globally unique id by means of pure Lua or by accessing redis, though that's a bit silly ;) If all you want is to get LAST_INSERT_ID, then ngx_drizzle already returns that automatically for you when you're doing a SQL insert query. Consider the following sample nginx.conf snippet: location /test { echo_location /mysql "drop table if exists foo"; echo; echo_location /mysql "create table foo (id serial not null, primary key (id), val real);"; echo; echo_location /mysql "insert into foo (val) values (3.1415926);"; echo; echo_location /mysql "select * from foo;"; echo; } location /mysql { drizzle_pass backend; drizzle_module_header off; drizzle_query $query_string; rds_json on; } Then GET /test gives the following outputs: {"errcode":0} {"errcode":0} {"errcode":0,"insert_id":1,"affected_rows":1} [{"id":1,"val":3.1415926}] Have you noticed the "insert_id" field in the 3rd JSON response? ;) Full transaction support will land into ngx_drizzle (maybe ngx_postgres as well). It will be implemented by locking and tagging database connections in the pool. But there's no ETA yet for that. > > You mentioned "cosocket" somewhere (github?) already and IMO that would > be really amazing! I'm following "agentzh" and "chaoslawful" on github > and will take a deeper look when i get more time. Will be linking to > your projects when i release something useful (safe) for it. > Oh, I'm feeling honored :) > > Looks very promising, i seen that page already on my researches and > would love to get my hands on it. I do a lot of research, trying as much > as possible, protocols like XMPP and PSYC and such good things, but > mostly everything apart from PHP, .Net and Java.. :> > LOL > > Heh. >.< All the thanks belong to you and who else is also behind that > projects! Had so much *fun* with it so far, you wont believe it how it > boosted everything at our groups site, ookeh not *that* much, but enough > to already left ruby (was riding since little rails). And personally it > helped me alot to grok lua, as i needed that for deeper reworks of my > prosody-im fork (another lua project thats awesome, i prefer it over > ejabberd/erl which indeed is both neat feature-wise, but wont let me > change (easily) from mnesia to redis or other nice tricks). > ngx_openresty still has many rough corners and has a long way to go. We'll surely try to make it better and better unfailingly :) Happy hacking! -agentzh From chaoslawful at gmail.com Thu May 5 07:36:57 2011 From: chaoslawful at gmail.com (Chaos Wang) Date: Thu, 05 May 2011 11:36:57 +0800 Subject: Lua pcre inside nginx In-Reply-To: References: Message-ID: <4DC21B59.4010309@gmail.com> NginX hooked pcre memory alloc/free functions pcre_malloc/free to use its memory pool, in order to work around its memory leaking problem. As a side effect, it reset this pool to NULL after every usage in core without considering possible external references. If you don't set pcre memory hooks to your own implementation, you will surely get the error. ngx_lua has fixed this problem, and can use pcre related extensions normally after v0.1.6rc5. Ref: * src/core/ngx_regex.c in NginX sources * ngx_http_lua_patch.c in ngx_lua sources On 2011?05?05? 03:03, Akins, Brian wrote: > I wanted to use pcre inside a lua script using rex_pcre. However, I always > get the error: > > failed to get memory (pattern offset: 15) > > The snippet of code always works in a standalone script. > > Ideas? > From nginx-forum at nginx.us Thu May 5 08:11:30 2011 From: nginx-forum at nginx.us (AndrewH) Date: Thu, 05 May 2011 00:11:30 -0400 Subject: Pre-process request via upstream then forward to proxy. Message-ID: As part of processing a request, I need to first send and receive a response to/from an upstream to authenticate some credentials in the request. Once this has been done, the original request needs to be proxied to another upstream. According to Evan Miller's tutorial, the only valid location for spawning sub-requests is in an output filter ie. to post-process a response. So it appears that this approach is useful for massaging a reponse but not valid for actually performing pre-processing on a request. Does anyone know what the sanctioned way of going about this in NGINX is? Or which existing modules/examples implement similar functionality? - Andrew Posted at Nginx Forum: http://forum.nginx.org/read.php?2,195702,195702#msg-195702 From Richard.Kearsley at m247.com Thu May 5 09:05:37 2011 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Thu, 5 May 2011 05:05:37 +0000 Subject: aio info Message-ID: Hi A lot of talk about AIO recently - I actually didn't know it existed before, so I am trying it on freebsd8 # sysctl -a | grep aio kern.features.aio: 1 vfs.aio.max_buf_aio: 16 vfs.aio.max_aio_queue_per_proc: 256 vfs.aio.max_aio_per_proc: 32 vfs.aio.unloadable: 0 vfs.aio.aiod_lifetime: 30000 vfs.aio.aiod_timeout: 10000 vfs.aio.num_buf_aio: 0 vfs.aio.num_queue_count: 0 vfs.aio.max_aio_queue: 1024 vfs.aio.target_aio_procs: 4 vfs.aio.num_aio_procs: 4 vfs.aio.max_aio_procs: 32 Could anyone comment what these mean and how to go about tweaking for best performance (should any be increased?) Particularly.. vfs.aio.num_queue_count - does this monitor the amount of io waiting? -------------- next part -------------- An HTML attachment was scrubbed... URL: From agentzh at gmail.com Thu May 5 10:11:32 2011 From: agentzh at gmail.com (agentzh) Date: Thu, 5 May 2011 14:11:32 +0800 Subject: Pre-process request via upstream then forward to proxy. In-Reply-To: References: Message-ID: On Thu, May 5, 2011 at 12:11 PM, AndrewH wrote: > As part of processing a request, I need to first send and receive a > response to/from an upstream to authenticate some credentials in the > request. ?Once this has been done, the original request needs to be > proxied to another upstream. > Your task can be trivially done in pure Lua by using the ngx_lua module. Specifically, by using the ngx.location.capture() interface for Lua to issue your subrequests and wait for the responses. See http://github.com/chaoslawful/lua-nginx-module for the full documentation. You can surely code it up in pure C by looking at how ngx_lua does on the C level. But it's not recommended because it's error prone and the performance gain is small. > According to Evan Miller's tutorial, the only valid location for > spawning sub-requests is in an output filter ie. to post-process a > response. Nope, you can surely create subrequests in any of your rewrite, access, and content phase handlers. That part of Evan Miller's tutorial is somehow misleading, and keep in mind that Evan stated like this: "as far as I know..." So he is not to blame ;) > Does anyone know what the sanctioned way of going about this in NGINX > is? ?Or which existing modules/examples implement similar > functionality? > See the echo_subrequest and echo_location directives provided by ngx_echo: http://github.com/agentzh/echo-nginx-module But their (synchronous but non-blocking) subrequest implementation is not as correct as ngx_lua's. The ngx_auth_request module by Maxim Dounin is an example of issuing subrequests in an access phase handler and my ngx_srcache module is another example for this: http://github.com/agentzh/srcache-nginx-module The ngx_eval module is an example of issuing subrequests in a rewrite phase handler: http://www.grid.net.ru/nginx/eval.en.html Happy subrequesting! -agentzh From mdounin at mdounin.ru Thu May 5 10:22:06 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 5 May 2011 10:22:06 +0400 Subject: no server response in https In-Reply-To: References: Message-ID: <20110505062206.GY42265@mdounin.ru> Hello! On Tue, May 03, 2011 at 01:42:42PM -0400, art.wu wrote: > I'm running 0.8.53 on QNX Neutrino 6.5.0 with SSL on and the server > doesn't respond to the client. Instead it times out, as below. It does > work properly with SSL off. Can you provide any suggestions? Thanks. Yep, this is general bug affecting systems with 32-bit off_t. Attached patch fixes it. Please note that using 64-bit off_t may be a good thing anyway (2G limit is two low today even on embedded platforms...), and it looks like QNX (at least 6.5.0) supports -D_FILE_OFFSET_BITS=64 (though nginx doesn't know and doesn't try it on QNX). Try using ./configure --with-cc-opt="-D_FILE_OFFSET_BITS=64" ... it should resolve the issue even without the patch. Please also note that there are other problems with QNX 6 due to time_t type being unsigned there. GCC will refuse to build nginx with -Werror (as used by nginx) - and this is the right thing. I'm looking into this issue, but it will require a bit more work. Maxim Dounin -------------- next part -------------- # HG changeset patch # User Maxim Dounin # Date 1304575111 -14400 # Node ID 0446d18df946f8cfae3f623d3335722d7c4489a6 # Parent 9b9e61f1b5004e0c5a2d56372e682c2a1e053e34 Bugfix: https wasn't working on systems with 32-bit off_t. Due to off_t being signed NGX_MAX_UINT32_VALUE will overflow off_t while calculating limit in ngx_ssl_send_chain() on systems with 32-bit time_t, and as a result ngx_ssl_send_chain() won't be able to send anything. Introduce NGX_MAX_INT32_VALUE and use it there instead. diff --git a/src/core/ngx_config.h b/src/core/ngx_config.h --- a/src/core/ngx_config.h +++ b/src/core/ngx_config.h @@ -127,5 +127,6 @@ typedef intptr_t ngx_flag_t; #define NGX_MAX_UINT32_VALUE (uint32_t) 0xffffffff #endif +#define NGX_MAX_INT32_VALUE (int32_t) 2147483647 #endif /* _NGX_CONFIG_H_INCLUDED_ */ diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c --- a/src/event/ngx_event_openssl.c +++ b/src/event/ngx_event_openssl.c @@ -957,10 +957,10 @@ ngx_ssl_send_chain(ngx_connection_t *c, } - /* the maximum limit size is the maximum uint32_t value - the page size */ - - if (limit == 0 || limit > (off_t) (NGX_MAX_UINT32_VALUE - ngx_pagesize)) { - limit = NGX_MAX_UINT32_VALUE - ngx_pagesize; + /* the maximum limit size is the maximum int32_t value - the page size */ + + if (limit == 0 || limit > (off_t) (NGX_MAX_INT32_VALUE - ngx_pagesize)) { + limit = NGX_MAX_INT32_VALUE - ngx_pagesize; } buf = c->ssl->buf; From mdounin at mdounin.ru Thu May 5 10:31:10 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 5 May 2011 10:31:10 +0400 Subject: Pre-process request via upstream then forward to proxy. In-Reply-To: References: Message-ID: <20110505063110.GZ42265@mdounin.ru> Hello! On Thu, May 05, 2011 at 12:11:30AM -0400, AndrewH wrote: > As part of processing a request, I need to first send and receive a > response to/from an upstream to authenticate some credentials in the > request. Once this has been done, the original request needs to be > proxied to another upstream. > > According to Evan Miller's tutorial, the only valid location for > spawning sub-requests is in an output filter ie. to post-process a > response. So it appears that this approach is useful for massaging a > reponse but not valid for actually performing pre-processing on a > request. Evan Miller's claim was correct before 0.7.25. In recent versions you may issue subrequests almost everywhere. There are some caveats though - it's up to you to take appropriate measures to ensure subrequest response won't appear on client's connection. > Does anyone know what the sanctioned way of going about this in NGINX > is? Or which existing modules/examples implement similar > functionality? Take a look at: http://grid.net.ru/nginx/eval.en.html http://mdounin.ru/hg/ngx_http_auth_request_module/ Maxim Dounin From igor at sysoev.ru Thu May 5 11:12:12 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 5 May 2011 11:12:12 +0400 Subject: aio info In-Reply-To: References: Message-ID: <20110505071212.GA36559@sysoev.ru> On Thu, May 05, 2011 at 05:05:37AM +0000, Richard Kearsley wrote: > Hi > A lot of talk about AIO recently - I actually didn't know it existed before, so I am trying it on freebsd8 > > # sysctl -a | grep aio > kern.features.aio: 1 > vfs.aio.max_buf_aio: 16 > vfs.aio.max_aio_queue_per_proc: 256 > vfs.aio.max_aio_per_proc: 32 > vfs.aio.unloadable: 0 > vfs.aio.aiod_lifetime: 30000 > vfs.aio.aiod_timeout: 10000 > vfs.aio.num_buf_aio: 0 > vfs.aio.num_queue_count: 0 > vfs.aio.max_aio_queue: 1024 > vfs.aio.target_aio_procs: 4 > vfs.aio.num_aio_procs: 4 > vfs.aio.max_aio_procs: 32 > > Could anyone comment what these mean and how to go about tweaking for best performance (should any be increased?) $ sysctl -d vfs.aio vfs.aio: Async IO management vfs.aio.max_buf_aio: Maximum buf aio requests per process (stored in the process) vfs.aio.max_aio_queue_per_proc: Maximum queued aio requests per process (stored in the process) vfs.aio.max_aio_per_proc: Maximum active aio requests per process (stored in the process) vfs.aio.unloadable: Allow unload of aio (not recommended) vfs.aio.aiod_lifetime: Maximum lifetime for idle aiod vfs.aio.aiod_timeout: Timeout value for synchronous aio operations vfs.aio.num_buf_aio: Number of aio requests presently handled by the buf subsystem vfs.aio.num_queue_count: Number of queued aio requests vfs.aio.max_aio_queue: Maximum number of aio requests to queue, globally vfs.aio.target_aio_procs: Preferred number of ready kernel threads for async IO vfs.aio.num_aio_procs: Number of presently active kernel threads for async IO vfs.aio.max_aio_procs: Maximum number of kernel threads to use for handling async IO There are two types AIO operations inside FreeBSD kernel - raw file AIO (buf aio) and usual file AIO that uses in-kernel threads/processes. nginx uses only usual file AIO. Relevant sysctls are: vfs.aio.max_aio_queue: 1024 vfs.aio.max_aio_queue_per_proc: 256 vfs.aio.max_aio_per_proc: 32 vfs.aio.num_queue_count: 0 vfs.aio.max_aio_procs: 32 vfs.aio.target_aio_procs: 4 vfs.aio.num_aio_procs: 4 vfs.aio.aiod_lifetime: 30000 vfs.aio.aiod_timeout: 10000 You may want to increase vfs.aio.max_aio_procs vfs.aio.max_aio_queue vfs.aio.max_aio_queue_per_proc vfs.aio.max_aio_per_proc > Particularly.. vfs.aio.num_queue_count - does this monitor the amount of io waiting? Yes. -- Igor Sysoev From igor at sysoev.ru Thu May 5 11:34:45 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 5 May 2011 11:34:45 +0400 Subject: How to avoid "too big header" issue? In-Reply-To: <65b155ed9ec7350b8df7cf617867f95e.NginxMailingListEnglish@forum.nginx.org> References: <12c7edea30d035b06c961d149e30db75.NginxMailingListEnglish@forum.nginx.org> <65b155ed9ec7350b8df7cf617867f95e.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110505073445.GC36559@sysoev.ru> On Wed, May 04, 2011 at 10:50:07PM -0400, stalkercn wrote: > nginx version: nginx/0.8.54 > configure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt='-I > /usr/local/include' --with-ld-opt='-L /usr/local/lib' > --conf-path=/usr/local/etc/nginx/nginx.conf > --sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid > --error-log-path=/var/log/nginx-error.log --user=www --group=www > --with-debug > --http-client-body-temp-path=/var/tmp/nginx/client_body_temp > --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp > --http-proxy-temp-path=/var/tmp/nginx/proxy_temp > --http-scgi-temp-path=/var/tmp/nginx/scgi_temp > --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp > --http-log-path=/var/log/nginx-access.log > --add-module=/usr/ports/www/nginx/work/ngx_headers_more_module-0.14 > --with-http_flv_module --with-http_gzip_static_module > --with-http_image_filter_module --with-http_stub_status_module > --with-pcre There was a bug when nginx was built --without-http_cache, but this is not your case. Could you try nginx-1.0.0 without third-party module ngx_headers_more_module ? -- Igor Sysoev From CBoyce at mersofmich.com Thu May 5 03:00:11 2011 From: CBoyce at mersofmich.com (Collin Boyce) Date: Wed, 4 May 2011 23:00:11 +0000 Subject: Exchange 2010 rpc ?? Message-ID: <2B45E42FC139C849A48677B3750F61810228FA@EMAIL-01.mersdomain1> We are not able to get nginx to reverse procy RPC to exchange 2010. We get repeating error messages in the log: x.x.x.x - - [04/May/2011:08:40:43 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:40:43 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:41:04 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:41:04 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:41:38 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:41:38 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:41:59 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:41:59 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:42:38 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:42:38 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:42:59 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:42:59 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:43:38 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:43:38 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:44:00 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:44:00 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:44:38 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:44:38 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:44:59 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:44:59 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:49:39 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:49:39 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:50:00 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:50:00 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:54:39 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:54:39 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:55:00 -0400] "-" 400 173 "-" "-" x.x.x.x - - [04/May/2011:08:55:00 -0400] "-" 400 173 "-" "-" The testexchangeconnectivity tool bombs with the following error: Config lines: location /rpc { proxy_pass https://mail.local/rpc; } Checking the IIS configuration for client certificate authentication. The test passed with some warnings encountered. Please expand the additional details. [Description: https://www.testexchangeconnectivity.com/Images/Minus.gif] Additional Details Client certificate authentication couldn't be determined because an unexpected failure occurred. WinHttpSendRequest failed with error 12152. [Description: https://www.testexchangeconnectivity.com/Images/Error.png] Testing HTTP Authentication Methods for URL https://mail.local/rpc/rpcproxy.dll. The HTTP authentication test failed. [Description: https://www.testexchangeconnectivity.com/Images/Minus.gif] Additional Details Exception details: Message: The server committed a protocol violation. Section=ResponseStatusLine Type: System.Net.WebException Stack trace: at System.Net.HttpWebRequest.GetResponse() at Microsoft.Exchange.Tools.ExRca.Tests.HttpAuthMethodsTest.GetSupportedHttpAuthMethods() at Microsoft.Exchange.Tools.ExRca.Tests.HttpAuthMethodsTest.PerformTestReally() -- CONFIDENTIALITY NOTICE: This email and any attachments are for the sole use of the intended recipient(s) and may contain information that is confidential and protected from disclosure under the law, including attorney-client communications. Any unauthorized review, use, disclosure, or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and delete/destroy all copies of the original message and attachments. DISCLAIMER: This email may contain a summary description of the Municipal Employees? Retirement System of Michigan benefits, costs, rates, valuations, or other calculations, policies or procedures. MERS has made every effort to ensure, but does not guarantee that the information provided is accurate and up to date. Where this email conflicts with the relevant MERS Plan Document, the MERS Plan Document controls. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 853 bytes Desc: image001.gif URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.png Type: image/png Size: 911 bytes Desc: image002.png URL: From pasik at iki.fi Thu May 5 17:23:14 2011 From: pasik at iki.fi (Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?=) Date: Thu, 5 May 2011 16:23:14 +0300 Subject: nginx proxying do not locally save/buffer uploaded files? In-Reply-To: <3dfd6d89a78e3ee124ed58524312dada.NginxMailingListEnglish@forum.nginx.org> References: <20110504214005.GM32595@reaktio.net> <3dfd6d89a78e3ee124ed58524312dada.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110505132314.GP32595@reaktio.net> On Wed, May 04, 2011 at 05:56:43PM -0400, jjjx128 wrote: > Pasi K?rkk?inen Wrote: > ------------------------------------------------------- > > in tcp mode you can't filter the requests etc.. I > > need to do that aswell. > > There are quite a few load balancers and proxies out there. I'm sure you > can find something useful. > I've checked and/or used most of them :) > > Maybe I need to take a look at the code and try to > > figure out > > if direct upload streaming could be implemented in > > nginx.. > > It is possible. So, good luck I guess. > Thanks. Are you familiar with nginx code? If yes, feel free to give advises what to avoid, and what to look for. (I haven't checked nginx code earlier, but I know C) -- Pasi From nginx-forum at nginx.us Thu May 5 19:25:19 2011 From: nginx-forum at nginx.us (art.wu) Date: Thu, 05 May 2011 11:25:19 -0400 Subject: no server response in https In-Reply-To: References: Message-ID: The configure option solved the problem. Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,195329,195791#msg-195791 From lists at ruby-forum.com Thu May 5 19:52:43 2011 From: lists at ruby-forum.com (Yanxin Z.) Date: Thu, 05 May 2011 17:52:43 +0200 Subject: memcache issue Message-ID: Hello, I am using PHP to connect to memcache. I connect memcache service in the PHP code as follows: $memcache = new Memcache; $memcache->connect('127.0.0.1', 11211); //connect to memcached server Then when I connect to NGX server, I got 500 or 502 error. However, if I run the memcache using php test.php directly, I can connect to memcache server successfully. I am using php-fpm. Does anyone encounter the similar issue before? Thanks, Yanxin -- Posted via http://www.ruby-forum.com/. From igor at sysoev.ru Thu May 5 20:01:29 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 5 May 2011 20:01:29 +0400 Subject: memcache issue In-Reply-To: References: Message-ID: <66EB54CA-3655-4BF3-BA6B-5FAF2910D8A1@sysoev.ru> What is in error_log ? -- Igor Sysoev 05.05.2011, ? 19:52, "Yanxin Z." ???????(?): > Hello, > I am using PHP to connect to memcache. > > I connect memcache service in the PHP code as follows: > $memcache = new Memcache; > $memcache->connect('127.0.0.1', 11211); //connect to memcached server > > > Then when I connect to NGX server, I got 500 or 502 error. > > However, if I run the memcache using php test.php directly, I can > connect to memcache server successfully. > > I am using php-fpm. > > Does anyone encounter the similar issue before? > > Thanks, > Yanxin > > -- > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx From lists at ruby-forum.com Thu May 5 20:10:27 2011 From: lists at ruby-forum.com (Yanxin Z.) Date: Thu, 05 May 2011 18:10:27 +0200 Subject: memcache issue In-Reply-To: References: Message-ID: <2f77714110eed19c0f3cc49c50d4cc3b@ruby-forum.com> Thank you for your help, Igor. The log is 1815426 2011/05/05 09:05:09 [notice] 13424#0: *15 "/api/1.0/(.*)/upload_internal" matches "/api/1.0/ web/upload_internal", client: 10.1.4.250, server: localhost, request: "POST /api/1.0/web/upload_internal HTTP/1.1", host: "10.1.4.243" 1815427 2011/05/05 09:05:09 [notice] 13424#0: *15 rewritten data: "/api/1.0/web/upload.php", args: "", client: 10.1.4.250, server: localhost, request: "POST /api/1.0/web/upload_internal HTTP/1.1", host: "10.1.4.243" 1815428 2011/05/05 09:05:09 [error] 13424#0: *15 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 10.1.4.250, server: localhost, request: "POST / api/1.0/web/upload_internal HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "10.1.4.243" 1815429 2011/05/05 09:05:09 [info] 13424#0: *15 client 10.1.4.250 closed keepalive connection -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu May 5 20:28:02 2011 From: lists at ruby-forum.com (Yanxin Z.) Date: Thu, 05 May 2011 18:28:02 +0200 Subject: memcache issue In-Reply-To: References: Message-ID: Hello Igor, Thank you for your direction. I searched for "nginx 104: Connection reset by peer" In the forum http://forum.slicehost.com/comments.php?DiscussionID=433 Someone suggest to restart fastcgi. I did restart php-fpm then, memcached is working now. Hopefully my post is helpful to other members. Yanxin -- Posted via http://www.ruby-forum.com/. From nginx-forum at nginx.us Thu May 5 20:29:00 2011 From: nginx-forum at nginx.us (HowToMeetLadies) Date: Thu, 05 May 2011 12:29:00 -0400 Subject: Catch ALL requests by LUA-script In-Reply-To: <962ffeb780843553c1f353008459a93f.NginxMailingListEnglish@forum.nginx.org> References: <962ffeb780843553c1f353008459a93f.NginxMailingListEnglish@forum.nginx.org> Message-ID: <43a20ba24767aaf66b89c49525531ecd.NginxMailingListEnglish@forum.nginx.org> > Oh, I'm so happy to hear that ;) Please bring my > best wishes to your cousin! > > > > > Sure, thats no problem. Tomorrow ill attach to > it and take a sample for > > you. Have also a full dump, as every build has > its own /prefix. > > > > Looking forward to that :) Will do both as soon i'll arrive at home later this day! > > When you're using ngx_redis2 + lua-redis-parser, > please ensure you're > using a tcp connection pool (provided by > ngx_http_upstream_keepalive) > and redis pipelining wherever possible. These > features will > significantly improve performance. Also, using > multiple instance of > redis servers on your multi-core machines also > help a lot due to the > sequential processing nature of a single redis > server instance. > > Also, when you're benchmarking performance, please > ensure that your > error log level is high enough to prevent nginx > workers spend too much > cycles on flushing the error.log file, which is > certainly very > expensive :) > Thank you for this, my conf applied already to this, but maybe you should tell about that in your docs too. (: > > As a last resort for mysql i thought of getting > an unique id from a > > (lua) location which is then used for insertion > and afterwards on > > success, i.e. for redirects. Or have i missed > something, what would you > > do? > > > > You can certainly generate a globally unique id by > means of pure Lua > or by accessing redis, though that's a bit silly > ;) > > If all you want is to get LAST_INSERT_ID, then > ngx_drizzle already > returns that automatically for you when you're > doing a SQL insert > query. Consider the following sample nginx.conf > snippet: > > location /test { > echo_location /mysql "drop table if exists > foo"; > echo; > echo_location /mysql "create table foo (id > serial not null, > primary key (id), val real);"; > echo; > echo_location /mysql "insert into foo > (val) values (3.1415926);"; > echo; > echo_location /mysql "select * from foo;"; > echo; > } > location /mysql { > drizzle_pass backend; > drizzle_module_header off; > drizzle_query $query_string; > rds_json on; > } > > Then GET /test gives the following outputs: > > {"errcode":0} > {"errcode":0} > {"errcode":0,"insert_id":1,"affected_rows":1} > [{"id":1,"val":3.1415926}] > > Have you noticed the "insert_id" field in the 3rd > JSON response? ;) > Unbelievable! :D Ive seen "insert id" header in ngx_drizzle, but hadnt looked further at inserts with rds_json (damn stupid me, i should write an article about that). > > LOL > I have a php-fpm install for exactly 3 apps which are our webmail/cms/board, because php-users are not aware of their risks ive disabled it apart from that. NCARS rulez, but im replacing it already -> xmpp (psyc) + web frontend. I used techniques like MEF and such in .Net, but imho its desktop-only.. One can do amazing things with it, also without using client-side runtime, but if you're not bound to that platform, why would you do? Its good to have varnish, ha and/or simple nginx in front of such servers/frameworks, but now nginx+lua is enough, its so tiny and fast.. > > Happy hacking! > Greetz (; # HTML Posted at Nginx Forum: http://forum.nginx.org/read.php?2,179364,195814#msg-195814 From nginx-forum at nginx.us Thu May 5 22:59:24 2011 From: nginx-forum at nginx.us (Jim Ohlstein) Date: Thu, 05 May 2011 14:59:24 -0400 Subject: Nginx Forum now accessible via IPv6 Message-ID: <18c2af52be92de23fc8c029b1e344080.NginxMailingListEnglish@forum.nginx.org> Generally I prefer to keep forum business on the forum but given the current state of IPv4 addresses and the upcoming World IPv6 Day on June 8, 2011 - see http://isoc.org/wp/worldipv6day/ - I am pleased to announce that the forum now has "native" IPv6 support. Most people who have an IPv4/IPv6 dual stack either natively from their ISP or by using a tunnel, and is using a modern browser, will likely be connecting via IPv6. Please let me know if there any connectivity issues, either via reply or directly at jim [at] ohlste [dot] in. Many Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,195868,195868#msg-195868 From nginx-forum at nginx.us Fri May 6 06:45:21 2011 From: nginx-forum at nginx.us (stalkercn) Date: Thu, 05 May 2011 22:45:21 -0400 Subject: How to avoid "too big header" issue? In-Reply-To: <12c7edea30d035b06c961d149e30db75.NginxMailingListEnglish@forum.nginx.org> References: <12c7edea30d035b06c961d149e30db75.NginxMailingListEnglish@forum.nginx.org> Message-ID: <80af9b27411dbe556335e96bd8912214.NginxMailingListEnglish@forum.nginx.org> nginx: nginx version: nginx/1.0.1 nginx: built by gcc 4.2.1 20070719 [FreeBSD] nginx: configure arguments: --prefix=/usr/local/etc/nginx --with-cc-opt='-I /usr/local/include' --with-ld-opt='-L /usr/local/lib' --conf-path=/usr/local/etc/nginx/nginx.conf --sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx.log --user=www --group=www --with-debug --http-client-body-temp-path=/var/tmp/nginx/client_body_temp --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp --http-proxy-temp-path=/var/tmp/nginx/proxy_temp --http-scgi-temp-path=/var/tmp/nginx/scgi_temp --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp --http-log-path=/var/log/nginx-access.log --with-http_gzip_static_module --with-http_stub_status_module --with-pcre I decrease the fastcgi buffer size and increase the amount of buffers: fastcgi_buffer_size 64k; fastcgi_buffers 64 64k; but a 'too big header' error still apears: [debug] upstream split a header line in FastCGI records [error] upstream sent too big header while reading response header from upstream btw,php is working with Zend-Optimizer,whether this condition can make the headers bigger than its real size? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,192785,195960#msg-195960 From agentzh at gmail.com Fri May 6 08:26:41 2011 From: agentzh at gmail.com (agentzh) Date: Fri, 6 May 2011 12:26:41 +0800 Subject: Catch ALL requests by LUA-script In-Reply-To: <43a20ba24767aaf66b89c49525531ecd.NginxMailingListEnglish@forum.nginx.org> References: <962ffeb780843553c1f353008459a93f.NginxMailingListEnglish@forum.nginx.org> <43a20ba24767aaf66b89c49525531ecd.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Fri, May 6, 2011 at 12:29 AM, HowToMeetLadies wrote: >> >> Also, when you're benchmarking performance, please >> ensure that your >> error log level is high enough to prevent nginx >> workers spend too much >> cycles on flushing the error.log file, which is >> certainly very >> expensive :) >> > > Thank you for this, my conf applied already to this, but maybe you > should tell about that in your docs too. (: > Just added to ngx_redis2's README ;) >> Then GET /test gives the following outputs: >> >> ? ? {"errcode":0} >> ? ? {"errcode":0} >> ? ? {"errcode":0,"insert_id":1,"affected_rows":1} >> ? ? [{"id":1,"val":3.1415926}] >> >> Have you noticed the "insert_id" field in the 3rd >> JSON response? ;) >> > > Unbelievable! :D Ive seen "insert id" header in ngx_drizzle, but hadnt > looked further at inserts with rds_json (damn stupid me, i should write > an article about that). Just added this to ngx_drizzle's README too :) My bad, it's indeed not that obvious for new users ;) Thanks! -agentzh From mcabral84 at bol.com.br Fri May 6 05:33:02 2011 From: mcabral84 at bol.com.br (Marcelo Cabral) Date: Thu, 5 May 2011 22:33:02 -0300 Subject: FastCGI server status Message-ID: Hello, I was wondering if I could monitor FastCGI responses (timers, success, failures, round robin stats, etc...) with nginx? Any hints on how I could get this info? Thanks -Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor at sysoev.ru Fri May 6 08:42:32 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 6 May 2011 08:42:32 +0400 Subject: How to avoid "too big header" issue? In-Reply-To: <80af9b27411dbe556335e96bd8912214.NginxMailingListEnglish@forum.nginx.org> References: <12c7edea30d035b06c961d149e30db75.NginxMailingListEnglish@forum.nginx.org> <80af9b27411dbe556335e96bd8912214.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110506044232.GE85186@sysoev.ru> On Thu, May 05, 2011 at 10:45:21PM -0400, stalkercn wrote: > nginx: nginx version: nginx/1.0.1 > nginx: built by gcc 4.2.1 20070719 [FreeBSD] > nginx: configure arguments: --prefix=/usr/local/etc/nginx > --with-cc-opt='-I /usr/local/include' --with-ld-opt='-L /usr/local/lib' > --conf-path=/usr/local/etc/nginx/nginx.conf > --sbin-path=/usr/local/sbin/nginx --pid-path=/var/run/nginx.pid > --error-log-path=/var/log/nginx.log --user=www --group=www --with-debug > --http-client-body-temp-path=/var/tmp/nginx/client_body_temp > --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi_temp > --http-proxy-temp-path=/var/tmp/nginx/proxy_temp > --http-scgi-temp-path=/var/tmp/nginx/scgi_temp > --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi_temp > --http-log-path=/var/log/nginx-access.log --with-http_gzip_static_module > --with-http_stub_status_module --with-pcre > > I decrease the fastcgi buffer size and increase the amount of buffers: > fastcgi_buffer_size 64k; > fastcgi_buffers 64 64k; > > but a 'too big header' error still apears: > > [debug] upstream split a header line in FastCGI records > [error] upstream sent too big header while reading response header > from upstream Only fastcgi_buffer_size is relevant here. Could you set it to 512k and make request with debug log ? -- Igor Sysoev From nginx-forum at nginx.us Fri May 6 10:34:03 2011 From: nginx-forum at nginx.us (stalkercn) Date: Fri, 06 May 2011 02:34:03 -0400 Subject: How to avoid "too big header" issue? In-Reply-To: <12c7edea30d035b06c961d149e30db75.NginxMailingListEnglish@forum.nginx.org> References: <12c7edea30d035b06c961d149e30db75.NginxMailingListEnglish@forum.nginx.org> Message-ID: http://www.toofiles.com/zh/rawfilesdownload-documents-log-nginx.html Posted at Nginx Forum: http://forum.nginx.org/read.php?2,192785,195989#msg-195989 From igor at sysoev.ru Fri May 6 10:42:22 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 6 May 2011 10:42:22 +0400 Subject: How to avoid "too big header" issue? In-Reply-To: References: <12c7edea30d035b06c961d149e30db75.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110506064222.GK85186@sysoev.ru> On Fri, May 06, 2011 at 02:34:03AM -0400, stalkercn wrote: > http://www.toofiles.com/zh/rawfilesdownload-documents-log-nginx.html According to this log nginx uses 4k fastcgi_buffer_size. Could you show your configuration ? -- Igor Sysoev From igor at sysoev.ru Fri May 6 10:46:04 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 6 May 2011 10:46:04 +0400 Subject: FastCGI server status In-Reply-To: References: Message-ID: <20110506064604.GL85186@sysoev.ru> On Thu, May 05, 2011 at 10:33:02PM -0300, Marcelo Cabral wrote: > Hello, > > I was wondering if I could monitor FastCGI responses (timers, success, > failures, round robin stats, etc...) with nginx? > Any hints on how I could get this info? Only by logging variables: $upstream_response_time $upstream_status $upstream_addr -- Igor Sysoev From nginx-forum at nginx.us Fri May 6 10:52:54 2011 From: nginx-forum at nginx.us (stalkercn) Date: Fri, 06 May 2011 02:52:54 -0400 Subject: How to avoid "too big header" issue? In-Reply-To: References: <12c7edea30d035b06c961d149e30db75.NginxMailingListEnglish@forum.nginx.org> Message-ID: <352f1144fc8d4f12c32877f9005f9439.NginxMailingListEnglish@forum.nginx.org> http://www.toofiles.com/zh/rawfilesdownload-documents-conf-nginx.html Posted at Nginx Forum: http://forum.nginx.org/read.php?2,192785,195996#msg-195996 From igor at sysoev.ru Fri May 6 10:59:36 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 6 May 2011 10:59:36 +0400 Subject: How to avoid "too big header" issue? In-Reply-To: References: <12c7edea30d035b06c961d149e30db75.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110506065936.GM85186@sysoev.ru> On Fri, May 06, 2011 at 02:34:03AM -0400, stalkercn wrote: > http://www.toofiles.com/zh/rawfilesdownload-documents-log-nginx.html nginx does not merge locations as Apache does, so: location / { root /home/www; index index.php index.html; } location ~ \.php$ { root /home/www; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/www$fastcgi_script_name; include fastcgi_params; fastcgi_temp_file_write_size 10m; fastcgi_busy_buffers_size 512k; fastcgi_buffer_size 512k; fastcgi_buffers 16 512k; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_intercept_errors on; fastcgi_next_upstream error invalid_header timeout http_500; } -- Igor Sysoev From nginx-forum at nginx.us Fri May 6 11:22:23 2011 From: nginx-forum at nginx.us (stalkercn) Date: Fri, 06 May 2011 03:22:23 -0400 Subject: How to avoid "too big header" issue? In-Reply-To: <352f1144fc8d4f12c32877f9005f9439.NginxMailingListEnglish@forum.nginx.org> References: <12c7edea30d035b06c961d149e30db75.NginxMailingListEnglish@forum.nginx.org> <352f1144fc8d4f12c32877f9005f9439.NginxMailingListEnglish@forum.nginx.org> Message-ID: <800b866ac3bd2851be3bd5dbc62e9c73.NginxMailingListEnglish@forum.nginx.org> ooh a foolish fault! But as seem as proxy mode,between two contiguous lines in the debug log,the time is 4-5 seconds,I dont know why? eg: 2011/05/06 15:14:10 [debug] 86514#0: *101 http upstream request: "/general/mytable/intel_view/index.php?" 2011/05/06 15:14:10 [debug] 86514#0: *101 http upstream dummy handler 2011/05/06 15:14:10 [debug] 86514#0: timer delta: 100 2011/05/06 15:14:10 [debug] 86514#0: posted events 0000000000000000 2011/05/06 15:14:10 [debug] 86514#0: worker cycle 2011/05/06 15:14:10 [debug] 86514#0: kevent timer: 299900, changes: 0 2011/05/06 15:14:14 [debug] 86514#0: kevent events: 1 2011/05/06 15:14:14 [debug] 86514#0: kevent: 8: ft:-1 fl:0020 ff:00000000 d:5816 ud:0000000801102150 2011/05/06 15:14:14 [debug] 86514#0: *101 http upstream request: "/general/mytable/intel_view/index.php?" 2011/05/06 15:14:14 [debug] 86514#0: *101 http upstream process header 2011/05/06 15:14:14 [debug] 86514#0: *101 malloc: 0000000801302000:524288 the full log: http://www.toofiles.com/zh/rawfilesdownload-documents-7z-nginx_log.html Posted at Nginx Forum: http://forum.nginx.org/read.php?2,192785,195999#msg-195999 From igor at sysoev.ru Fri May 6 11:39:02 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 6 May 2011 11:39:02 +0400 Subject: How to avoid "too big header" issue? In-Reply-To: <800b866ac3bd2851be3bd5dbc62e9c73.NginxMailingListEnglish@forum.nginx.org> References: <12c7edea30d035b06c961d149e30db75.NginxMailingListEnglish@forum.nginx.org> <352f1144fc8d4f12c32877f9005f9439.NginxMailingListEnglish@forum.nginx.org> <800b866ac3bd2851be3bd5dbc62e9c73.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110506073902.GA98651@sysoev.ru> On Fri, May 06, 2011 at 03:22:23AM -0400, stalkercn wrote: > ooh a foolish fault! > But as seem as proxy mode,between two contiguous lines in the debug > log,the time is 4-5 seconds,I dont know why? > > eg: > 2011/05/06 15:14:10 [debug] 86514#0: *101 http upstream request: > "/general/mytable/intel_view/index.php?" > 2011/05/06 15:14:10 [debug] 86514#0: *101 http upstream dummy handler > 2011/05/06 15:14:10 [debug] 86514#0: timer delta: 100 > 2011/05/06 15:14:10 [debug] 86514#0: posted events 0000000000000000 > 2011/05/06 15:14:10 [debug] 86514#0: worker cycle > 2011/05/06 15:14:10 [debug] 86514#0: kevent timer: 299900, changes: 0 > 2011/05/06 15:14:14 [debug] 86514#0: kevent events: 1 > 2011/05/06 15:14:14 [debug] 86514#0: kevent: 8: ft:-1 fl:0020 > ff:00000000 d:5816 ud:0000000801102150 > 2011/05/06 15:14:14 [debug] 86514#0: *101 http upstream request: > "/general/mytable/intel_view/index.php?" > 2011/05/06 15:14:14 [debug] 86514#0: *101 http upstream process header > 2011/05/06 15:14:14 [debug] 86514#0: *101 malloc: > 0000000801302000:524288 > > the full log: > http://www.toofiles.com/zh/rawfilesdownload-documents-7z-nginx_log.html 7z format is certainly not the best way to pack report logs. There is old good gzip: it's enough. As to delay, it seems that is is PHP delay. -- Igor Sysoev From nginx-forum at nginx.us Fri May 6 12:02:45 2011 From: nginx-forum at nginx.us (stalkercn) Date: Fri, 06 May 2011 04:02:45 -0400 Subject: How to avoid "too big header" issue? In-Reply-To: <800b866ac3bd2851be3bd5dbc62e9c73.NginxMailingListEnglish@forum.nginx.org> References: <12c7edea30d035b06c961d149e30db75.NginxMailingListEnglish@forum.nginx.org> <352f1144fc8d4f12c32877f9005f9439.NginxMailingListEnglish@forum.nginx.org> <800b866ac3bd2851be3bd5dbc62e9c73.NginxMailingListEnglish@forum.nginx.org> Message-ID: OK?I'll find out php problem,thanks anyway. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,192785,196007#msg-196007 From Richard.Kearsley at m247.com Fri May 6 13:37:12 2011 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Fri, 6 May 2011 09:37:12 +0000 Subject: aio info In-Reply-To: <20110505071212.GA36559@sysoev.ru> References: <20110505071212.GA36559@sysoev.ru> Message-ID: Is aio used while reading files from proxy_cache? I test aio on a file every 1s (it should be in ram buffers, so no disk io needed) Usually it takes 1ms (or lower), but sometimes it spikes to over a second if disks are really busy The max_aio_queue doesn't go above 3-4 during test Any ideas the cause of spikes? -----Original Message----- From: Igor Sysoev [mailto:igor at sysoev.ru] Sent: 05 May 2011 08:12 To: nginx at nginx.org Subject: Re: aio info On Thu, May 05, 2011 at 05:05:37AM +0000, Richard Kearsley wrote: > Hi > A lot of talk about AIO recently - I actually didn't know it existed before, so I am trying it on freebsd8 > > # sysctl -a | grep aio > kern.features.aio: 1 > vfs.aio.max_buf_aio: 16 > vfs.aio.max_aio_queue_per_proc: 256 > vfs.aio.max_aio_per_proc: 32 > vfs.aio.unloadable: 0 > vfs.aio.aiod_lifetime: 30000 > vfs.aio.aiod_timeout: 10000 > vfs.aio.num_buf_aio: 0 > vfs.aio.num_queue_count: 0 > vfs.aio.max_aio_queue: 1024 > vfs.aio.target_aio_procs: 4 > vfs.aio.num_aio_procs: 4 > vfs.aio.max_aio_procs: 32 > > Could anyone comment what these mean and how to go about tweaking for best performance (should any be increased?) $ sysctl -d vfs.aio vfs.aio: Async IO management vfs.aio.max_buf_aio: Maximum buf aio requests per process (stored in the process) vfs.aio.max_aio_queue_per_proc: Maximum queued aio requests per process (stored in the process) vfs.aio.max_aio_per_proc: Maximum active aio requests per process (stored in the process) vfs.aio.unloadable: Allow unload of aio (not recommended) vfs.aio.aiod_lifetime: Maximum lifetime for idle aiod vfs.aio.aiod_timeout: Timeout value for synchronous aio operations vfs.aio.num_buf_aio: Number of aio requests presently handled by the buf subsystem vfs.aio.num_queue_count: Number of queued aio requests vfs.aio.max_aio_queue: Maximum number of aio requests to queue, globally vfs.aio.target_aio_procs: Preferred number of ready kernel threads for async IO vfs.aio.num_aio_procs: Number of presently active kernel threads for async IO vfs.aio.max_aio_procs: Maximum number of kernel threads to use for handling async IO There are two types AIO operations inside FreeBSD kernel - raw file AIO (buf aio) and usual file AIO that uses in-kernel threads/processes. nginx uses only usual file AIO. Relevant sysctls are: vfs.aio.max_aio_queue: 1024 vfs.aio.max_aio_queue_per_proc: 256 vfs.aio.max_aio_per_proc: 32 vfs.aio.num_queue_count: 0 vfs.aio.max_aio_procs: 32 vfs.aio.target_aio_procs: 4 vfs.aio.num_aio_procs: 4 vfs.aio.aiod_lifetime: 30000 vfs.aio.aiod_timeout: 10000 You may want to increase vfs.aio.max_aio_procs vfs.aio.max_aio_queue vfs.aio.max_aio_queue_per_proc vfs.aio.max_aio_per_proc > Particularly.. vfs.aio.num_queue_count - does this monitor the amount of io waiting? Yes. -- Igor Sysoev _______________________________________________ nginx mailing list nginx at nginx.org http://nginx.org/mailman/listinfo/nginx From igor at sysoev.ru Fri May 6 14:50:17 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 6 May 2011 14:50:17 +0400 Subject: aio info In-Reply-To: References: <20110505071212.GA36559@sysoev.ru> Message-ID: <20110506105017.GD3100@sysoev.ru> On Fri, May 06, 2011 at 09:37:12AM +0000, Richard Kearsley wrote: > Is aio used while reading files from proxy_cache? Yes, it works. For FreeBSD I recommend this settings: sendfile on; aio sendfile; tcp_nopush on; read_ahead 512k; > I test aio on a file every 1s (it should be in ram buffers, so no disk io needed) > Usually it takes 1ms (or lower), but sometimes it spikes to over a second if disks are really busy > The max_aio_queue doesn't go above 3-4 during test > Any ideas the cause of spikes? May be locks on VFS level. You can try this: open_file_cache max=5000 inactive=20s; open_file_cache_valid 30s; open_file_cache_min_uses 3; -- Igor Sysoev From ionathan at gmail.com Fri May 6 15:01:27 2011 From: ionathan at gmail.com (Jonathan Leibiusky) Date: Fri, 6 May 2011 08:01:27 -0300 Subject: Virtualization Message-ID: Hey! I am trying to virtualize nginx in my own private cloud. Is there any special consideration regard configuration that I have to consider? Anyone did something similar? Regard throughput, anyone with some numbers to share? Thanks! Jonathan From Richard.Kearsley at m247.com Fri May 6 16:52:51 2011 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Fri, 6 May 2011 12:52:51 +0000 Subject: aio info In-Reply-To: <20110506105017.GD3100@sysoev.ru> References: <20110505071212.GA36559@sysoev.ru> <20110506105017.GD3100@sysoev.ru> Message-ID: Hi Many thanks for your help, it is much appreciated. I am still getting these pauses. They happen every 30 seconds on the dot. What could be running/locking every 30 seconds? System disk (ad4) incurs usage at this point, and this should not be being used (ad5 and ad6 are the cache disks) (note that I increased the valid/inactive times you exampled to 300s to rule that out) From igor at sysoev.ru Fri May 6 17:00:30 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 6 May 2011 17:00:30 +0400 Subject: aio info In-Reply-To: References: <20110505071212.GA36559@sysoev.ru> <20110506105017.GD3100@sysoev.ru> Message-ID: <20110506130030.GE3100@sysoev.ru> On Fri, May 06, 2011 at 12:52:51PM +0000, Richard Kearsley wrote: > Hi > Many thanks for your help, it is much appreciated. > I am still getting these pauses. They happen every 30 seconds on the dot. > What could be running/locking every 30 seconds? System disk (ad4) incurs usage at this point, and this should not be being used (ad5 and ad6 are the cache disks) > (note that I increased the valid/inactive times you exampled to 300s to rule that out) Could you run "top -S" and "systat -v 1" at time near to these peaks ? -- Igor Sysoev From nginx-forum at nginx.us Fri May 6 17:38:46 2011 From: nginx-forum at nginx.us (yellowbox9) Date: Fri, 06 May 2011 09:38:46 -0400 Subject: empty reply from server Message-ID: <4cd88446bdeea09b413fae442fa115e7.NginxMailingListEnglish@forum.nginx.org> I'm setting up a new nginx environment and I'm having issues with 404's. When I use curl to request a file that I know does not exist, nginx responds back with an empty reply.... I would prefer a 404 not found with the correct http status code. My config: user nobody; worker_processes 4; worker_rlimit_nofile 8192; events { worker_connections 4096; } http { include mime.types; default_type text/plain; log_format nn '$host $remote_addr - $remote_user [$time_local] ' '"$request" $status $bytes_sent ' '"$http_referer" "$http_user_agent"'; access_log /opt/nginx/logs/access.log nn; error_log /opt/nginx/logs/error.log; sendfile on; keepalive_timeout 0; server { listen 80 default; root /opt/nginx/html/; index index.html index.htm index.php index.php5; include /opt/nginx/conf/location_php.conf; } include /opt/nginx/conf/vhosts/*.conf; } The html root dir: bash> ls /opt/nginx/html/ 404.html 50x.html empty.html foobar index.html ping The curl request: curl -v http://localhost/index.html2 * About to connect() to localhost port 80 * Trying 127.0.0.1... connected * Connected to localhost (127.0.0.1) port 80 > GET /index.html2 HTTP/1.1 > User-Agent: curl/7.15.5 (i386-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 > Host: localhost > Accept: */* > * Empty reply from server * Connection #0 to host localhost left intact curl: (52) Empty reply from server * Closing connection #0 The access log: localhost 127.0.0.1 - - [06/May/2011:09:35:17 -0400] "GET /index.html2 HTTP/1.1" 200 0 "-" "curl/7.15.5 (i386-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5" - For some reason returning http status code 200? The error log: 2011/05/06 09:35:17 [error] 9879#0: *9312 open() "/opt/nginx/html/index.html2" failed (2: No such file or directory), client: 127.0.0.1, server: , request: "GET /index.html2 HTTP/1.1", host: "localhost" I don't understand what I'm doing wrong here... any thoughts? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,196075,196075#msg-196075 From Richard.Kearsley at m247.com Fri May 6 17:49:58 2011 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Fri, 6 May 2011 13:49:58 +0000 Subject: aio info In-Reply-To: <20110506130030.GE3100@sysoev.ru> References: <20110505071212.GA36559@sysoev.ru> <20110506105017.GD3100@sysoev.ru> <20110506130030.GE3100@sysoev.ru> Message-ID: Hi Igor, Nothing stands out when looking at those stats (other than the disk %busy going from 50/60 straight up to 100). I.e. nothing is grabbing 100% cpu or something - there is barely 2% cpu usage and appears to drop during the 2-3 second lock period... Note that during my test, nginx is rebuilding the proxy_cache index (1,000,000's of files that it has to read from disk to build index after a restart) - does something happen with the cache manager process every 30 seconds during rebuild? From josh at joshparker.us Fri May 6 18:33:52 2011 From: josh at joshparker.us (Parker, Joshua) Date: Fri, 6 May 2011 10:33:52 -0400 Subject: Shared Hosting Message-ID: I have a dedicated server where i would like to offer shared hosting for WordPress multisite installs. What would be the best configuration for the virtual host files (more concerned with the server directive) since these sites will need to utilize dedicated IP's especially if they want to use domain mapping? Thanks for your help. -- Joshua Parker Church Management System - http://www.churchmember.us/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Fri May 6 19:22:15 2011 From: lists at ruby-forum.com (John Travolota) Date: Fri, 06 May 2011 17:22:15 +0200 Subject: PHP virtual impossible on nginx? Message-ID: <6cba0fd16dce811389b4bbcabf054e5b@ruby-forum.com> It seems this is impossible on nginx,since php virtual is function attached to apache,but still posting this in hope how someone managed to make this work.For some reason a lot of scripts uses php virtual include instead just php include and that means they cant work on nginx unless i use SSI with SHTML extension.But i realy dont like SHTML extension plus i need to have support for SSI included on nginx configure for that,would rather use php extension if possible. -- Posted via http://www.ruby-forum.com/. From nginx-forum at nginx.us Fri May 6 20:16:55 2011 From: nginx-forum at nginx.us (jfix) Date: Fri, 06 May 2011 12:16:55 -0400 Subject: trouble with forward proxying Message-ID: <4e5c2db6e47b5d013dfbb23fa21a4b8a.NginxMailingListEnglish@forum.nginx.org> Hello, I've looked far and wide but couldn't find an answer to my problem. Here's a quick description: an appserver must use the company's http proxy for outgoing http requests, but cannot be configured. So I (tried) set up nginx to act as a forward proxy, like this: server { listen 9099; resolver 10.102.10.14; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://proxy.example.org:80$scheme://$http_host$request_uri; } error_log /cygdrive/E/data/logs/forward-proxy-nginx-error.log debug; access_log /cygdrive/E/data/logs/forward-proxy-nginx-access.log combined buffer=32k; } I couldn't find any config examples where the parent proxy is used in the proxy_pass directive. It seems like there is no other way to specify the company proxy than to add it to the proxy_pass directive. The error message I get is this, apparently, nginx looks for a colon and takes the rest as the port number: 2011/05/06 18:01:32 [error] 2420#0: *1 invalid port in upstream "proxy.example.orghttp://www.google.com/", client: 127.0.0.1, server: , request: "GET http://www.google.com/ HTTP/1.1", host: "www.google.com" If I change the proxy_pass directive to proxy_pass http://proxy.example.org:80/$scheme://$http_host$request_uri; it's the parent proxy that complains that a URL cannot start with a / character: The following error was encountered while trying to retrieve the URL: /http://www.g oogle.com/ I'm at a loss how to continue. Could somebody please help? Thanks very much in advance, Jakob. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,196115,196115#msg-196115 From lpr at dyb.fm Fri May 6 20:20:24 2011 From: lpr at dyb.fm (Felipe Teofilo) Date: Fri, 6 May 2011 13:20:24 -0300 Subject: 502 Bad Gateway Message-ID: <978247EE-13A0-40BA-9886-61802681B105@dyb.fm> Hello, How can i change 502 bad gateway from all my vhosts, to do a unique erro page? I want redirect to /var/html/www/errors/502/ I try put at vhost config, but some time it doesnt work. Thanks, Felipe aka lpr From edhoprima at gmail.com Fri May 6 20:31:06 2011 From: edhoprima at gmail.com (Edho P Arief) Date: Fri, 6 May 2011 23:31:06 +0700 Subject: trouble with forward proxying In-Reply-To: <4e5c2db6e47b5d013dfbb23fa21a4b8a.NginxMailingListEnglish@forum.nginx.org> References: <4e5c2db6e47b5d013dfbb23fa21a4b8a.NginxMailingListEnglish@forum.nginx.org> Message-ID: On Fri, May 6, 2011 at 11:16 PM, jfix wrote: > I'm at a loss how to continue. Could somebody please help? ?Thanks very > much in advance, Jakob. > I don't know, perhaps it's related with nginx's description? From nginx-forum at nginx.us Fri May 6 21:16:55 2011 From: nginx-forum at nginx.us (uid_b) Date: Fri, 06 May 2011 13:16:55 -0400 Subject: Long URLs cause nginx to hang Message-ID: <16d8c9361e848788e6d2e07ecc8596db.NginxMailingListEnglish@forum.nginx.org> Hey everyone, I'm having strange issues with _very_ long url's under Nginx 1.0.1 (also tested under 0.8.54). Certain URL's with a large number of GET parameters are failing. I wrote a quick test script which only prints 1 line (php), and added a massive GET parameter: https://test/test.php?blah=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa This causes Nginx to hang indefinitely, the client receives absolutely no data (verified by tcpdump). Though, if I cut the parameter in half, it loads instantly. Is there a configuration directive I need to tweak in order to handle these massive URL's? Thanks! Ben Posted at Nginx Forum: http://forum.nginx.org/read.php?2,196131,196131#msg-196131 From nginx-forum at nginx.us Fri May 6 21:37:17 2011 From: nginx-forum at nginx.us (uid_b) Date: Fri, 06 May 2011 13:37:17 -0400 Subject: Long URLs cause nginx to hang In-Reply-To: <16d8c9361e848788e6d2e07ecc8596db.NginxMailingListEnglish@forum.nginx.org> References: <16d8c9361e848788e6d2e07ecc8596db.NginxMailingListEnglish@forum.nginx.org> Message-ID: update: to rule out fastcgi/php I ran the same test against a basic HTML file with the same GET parameter, same problem. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,196131,196138#msg-196138 From igor at sysoev.ru Fri May 6 21:55:20 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 6 May 2011 21:55:20 +0400 Subject: Long URLs cause nginx to hang In-Reply-To: References: <16d8c9361e848788e6d2e07ecc8596db.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110506175520.GB24743@sysoev.ru> On Fri, May 06, 2011 at 01:37:17PM -0400, uid_b wrote: > update: to rule out fastcgi/php I ran the same test against a basic HTML > file with the same GET parameter, same problem. Could you create a debug log of the HTML files request ? http://nginx.org/en/docs/debugging_log.html -- Igor Sysoev From igor at sysoev.ru Fri May 6 22:21:44 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 6 May 2011 22:21:44 +0400 Subject: trouble with forward proxying In-Reply-To: <4e5c2db6e47b5d013dfbb23fa21a4b8a.NginxMailingListEnglish@forum.nginx.org> References: <4e5c2db6e47b5d013dfbb23fa21a4b8a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110506182144.GE24743@sysoev.ru> On Fri, May 06, 2011 at 12:16:55PM -0400, jfix wrote: > Hello, I've looked far and wide but couldn't find an answer to my > problem. > > Here's a quick description: an appserver must use the company's http > proxy for outgoing http requests, but cannot be configured. So I (tried) > set up nginx to act as a forward proxy, like this: > > server { > listen 9099; > resolver 10.102.10.14; > location / { > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header Host $http_host; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > proxy_pass > http://proxy.example.org:80$scheme://$http_host$request_uri; > } > > error_log /cygdrive/E/data/logs/forward-proxy-nginx-error.log debug; > access_log /cygdrive/E/data/logs/forward-proxy-nginx-access.log > combined buffer=32k; > } > > I couldn't find any config examples where the parent proxy is used in > the proxy_pass directive. > > It seems like there is no other way to specify the company proxy than to > add it to the proxy_pass directive. > > The error message I get is this, apparently, nginx looks for a colon and > takes the rest as the port number: > > 2011/05/06 18:01:32 [error] 2420#0: *1 invalid port in upstream > "proxy.example.orghttp://www.google.com/", client: 127.0.0.1, server: , > request: "GET http://www.google.com/ HTTP/1.1", host: "www.google.com" > > If I change the proxy_pass directive to > > proxy_pass > http://proxy.example.org:80/$scheme://$http_host$request_uri; > > it's the parent proxy that complains that a URL cannot start with a / > character: > > The following error was encountered while trying to retrieve the URL: href="/http://www.google.com/">/http://www.g > oogle.com/ > > I'm at a loss how to continue. Could somebody please help? Thanks very > much in advance, Jakob. nginx is not intended to run as a forward proxy. -- Igor Sysoev From igor at sysoev.ru Fri May 6 22:30:36 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 6 May 2011 22:30:36 +0400 Subject: 502 Bad Gateway In-Reply-To: <978247EE-13A0-40BA-9886-61802681B105@dyb.fm> References: <978247EE-13A0-40BA-9886-61802681B105@dyb.fm> Message-ID: <20110506183036.GA30428@sysoev.ru> On Fri, May 06, 2011 at 01:20:24PM -0300, Felipe Teofilo wrote: > Hello, > > > How can i change 502 bad gateway from all my vhosts, to do a unique erro page? > > > I want redirect to /var/html/www/errors/502/ > > > I try put at vhost config, but some time it doesnt work. error_page 500 502 503 504 /50x.html; location = /50x.html { root /var/html/www/errors/502/; } -- Igor Sysoev From Brian.Akins at turner.com Fri May 6 22:46:49 2011 From: Brian.Akins at turner.com (Akins, Brian) Date: Fri, 06 May 2011 14:46:49 -0400 Subject: Lua pcre inside nginx In-Reply-To: <4DC21B59.4010309@gmail.com> Message-ID: On 5/4/11 11:36 PM, "Chaos Wang" wrote: > ngx_lua has fixed this problem, and can use pcre related extensions > normally after v0.1.6rc5. Thanks. Seems to work now. -- Brian Akins From nginx-forum at nginx.us Fri May 6 22:52:43 2011 From: nginx-forum at nginx.us (TECK) Date: Fri, 06 May 2011 14:52:43 -0400 Subject: MySQL and Nginx mystery Message-ID: <371f900423de05e1a7d49f9888dcfe64.NginxMailingListEnglish@forum.nginx.org> Hi all, I have set a fastcgi upstream into Nginx configuration: upstream fastcgi { ip_hash; server 192.168.0.2:9000; server 192.168.0.3:9000; server 192.168.0.4:9000; } Everything works perfect, except when I try to connect to MySQL, using PHP. $server = '192.168.0.40'; $username = 'tester'; $password = 'password'; mysql_connect($server, $username, $password); I get a connection error telling me that I cannot connect to MySQL using 192.168.0.2! (or whatever server I'm on it at that specific moment) Current setup: 3 web servers, 2 set with heartbeat, nginx as start service 2 db servers, set with heartbeat and DRBD, mysqld as start service Is there a header that I need to set into Nginx or this is a network configuration issue that I need to alert the host guys about? I did set the bind-address in my.cnf to 192.168.0.40 ip. Thanks for your help. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,196165,196165#msg-196165 From nginx-forum at nginx.us Fri May 6 22:56:10 2011 From: nginx-forum at nginx.us (uid_b) Date: Fri, 06 May 2011 14:56:10 -0400 Subject: Long URLs cause nginx to hang In-Reply-To: References: <16d8c9361e848788e6d2e07ecc8596db.NginxMailingListEnglish@forum.nginx.org> Message-ID: <9383ec9105c69a6fb02fbfbd183e9af9.NginxMailingListEnglish@forum.nginx.org> I get 2 different outputs, depending on whether the connection is SSL or not Non-SSL: 2011/05/06 12:52:44 [debug] 13267#0: *48 accept: 192.168.10.21 fd:3 2011/05/06 12:52:44 [debug] 13267#0: *48 event timer add: 3: 120000:1304708084457 2011/05/06 12:52:44 [debug] 13267#0: *48 epoll add event: fd:3 op:1 ev:80000001 SSL: 2011/05/06 12:48:49 [debug] 12804#0: *16 accept: 192.168.10.21 fd:3 2011/05/06 12:48:49 [debug] 12804#0: *16 event timer add: 3: 120000:1304707849612 2011/05/06 12:48:49 [debug] 12804#0: *16 epoll add event: fd:3 op:1 ev:80000001 2011/05/06 12:48:49 [debug] 12804#0: *16 malloc: 0000000001440680:1296 2011/05/06 12:48:49 [debug] 12804#0: *16 posix_memalign: 000000000138BEB0:256 @16 2011/05/06 12:48:49 [debug] 12804#0: *16 malloc: 0000000001229710:1024 2011/05/06 12:48:49 [debug] 12804#0: *16 posix_memalign: 000000000151E9E0:4096 @16 2011/05/06 12:48:49 [debug] 12804#0: *16 http check ssl handshake 2011/05/06 12:48:49 [debug] 12804#0: *16 https ssl handshake: 0x16 2011/05/06 12:48:49 [debug] 12804#0: *16 SSL server name: "seismo" 2011/05/06 12:48:49 [debug] 12804#0: *16 SSL_do_handshake: -1 2011/05/06 12:48:49 [debug] 12804#0: *16 SSL_get_error: 2 2011/05/06 12:48:49 [debug] 12804#0: *16 SSL handshake handler: 0 2011/05/06 12:48:49 [debug] 12804#0: *16 SSL_do_handshake: 1 2011/05/06 12:48:49 [debug] 12804#0: *16 SSL: TLSv1, cipher: "DHE-RSA-AES256-SHA SSLv3 Kx=DH Au=RSA Enc=AES(256) Mac=SHA1" 2011/05/06 12:48:49 [debug] 12804#0: *16 http process request line 2011/05/06 12:48:49 [debug] 12804#0: *16 SSL_read: -1 2011/05/06 12:48:49 [debug] 12804#0: *16 SSL_get_error: 2 If I remove the massive GET parameter: 2011/05/06 12:54:09 [debug] 13267#0: *69 accept: 192.168.10.21 fd:17 2011/05/06 12:54:09 [debug] 13267#0: *69 event timer add: 17: 120000:1304708169332 2011/05/06 12:54:09 [debug] 13267#0: *69 epoll add event: fd:17 op:1 ev:80000001 2011/05/06 12:54:09 [debug] 13267#0: *69 malloc: 00000000019EEE70:1296 2011/05/06 12:54:09 [debug] 13267#0: *69 posix_memalign: 0000000001B9B460:256 @16 2011/05/06 12:54:09 [debug] 13267#0: *69 malloc: 00000000019E0710:1024 2011/05/06 12:54:09 [debug] 13267#0: *69 posix_memalign: 0000000001C0AA40:4096 @16 2011/05/06 12:54:09 [debug] 13267#0: *69 http process request line 2011/05/06 12:54:09 [debug] 13267#0: *69 recv: fd:17 645 of 1024 2011/05/06 12:54:09 [debug] 13267#0: *69 http request line: "GET /test.html HTTP/1.1" 2011/05/06 12:54:09 [debug] 13267#0: *69 http uri: "/test.html" 2011/05/06 12:54:09 [debug] 13267#0: *69 http args: "" 2011/05/06 12:54:09 [debug] 13267#0: *69 http exten: "html" 2011/05/06 12:54:09 [debug] 13267#0: *69 http process request header line 2011/05/06 12:54:09 [debug] 13267#0: *69 http header: "Host: seismo" 2011/05/06 12:54:09 [debug] 13267#0: *69 http header: "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1" 2011/05/06 12:54:09 [debug] 13267#0: *69 http header: "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" 2011/05/06 12:54:09 [debug] 13267#0: *69 http header: "Accept-Language: en-us,en;q=0.5" 2011/05/06 12:54:09 [debug] 13267#0: *69 http header: "Accept-Encoding: gzip, deflate" 2011/05/06 12:54:09 [debug] 13267#0: *69 http header: "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" 2011/05/06 12:54:09 [debug] 13267#0: *69 http header: "Keep-Alive: 115" 2011/05/06 12:54:09 [debug] 13267#0: *69 http header: "Connection: keep-alive" 2011/05/06 12:54:09 [debug] 13267#0: *69 http header: "Cookie: PHPSESSID=l3a89kpj6j0es6qbkkf1nd1p80; __utma=16576436.82209771.1304707931.1304707931.1304707931.1; __utmb=16576436.2.10.1304707931; __utmc=16576436; __utmz=16576436.1304707931.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)" 2011/05/06 12:54:09 [debug] 13267#0: *69 http header: "If-Modified-Since: Fri, 06 May 2011 18:36:06 GMT" 2011/05/06 12:54:09 [debug] 13267#0: *69 http header done 2011/05/06 12:54:09 [debug] 13267#0: *69 event timer del: 17: 1304708169332 2011/05/06 12:54:09 [debug] 13267#0: *69 generic phase: 0 2011/05/06 12:54:09 [debug] 13267#0: *69 rewrite phase: 1 2011/05/06 12:54:09 [debug] 13267#0: *69 test location: "/" 2011/05/06 12:54:09 [debug] 13267#0: *69 test location: ~ "\.php" 2011/05/06 12:54:09 [debug] 13267#0: *69 test location: ~ "/\.ht" 2011/05/06 12:54:09 [debug] 13267#0: *69 using configuration "/sparkle" 2011/05/06 12:54:09 [debug] 13267#0: *69 http cl:-1 max:10485760 2011/05/06 12:54:09 [debug] 13267#0: *69 rewrite phase: 3 2011/05/06 12:54:09 [debug] 13267#0: *69 post rewrite phase: 4 2011/05/06 12:54:09 [debug] 13267#0: *69 generic phase: 5 2011/05/06 12:54:09 [debug] 13267#0: *69 generic phase: 6 2011/05/06 12:54:09 [debug] 13267#0: *69 generic phase: 7 2011/05/06 12:54:09 [debug] 13267#0: *69 access phase: 8 2011/05/06 12:54:09 [debug] 13267#0: *69 access phase: 9 2011/05/06 12:54:09 [debug] 13267#0: *69 post access phase: 10 2011/05/06 12:54:09 [debug] 13267#0: *69 try files phase: 11 2011/05/06 12:54:09 [debug] 13267#0: *69 http script var: "/test.html" 2011/05/06 12:54:09 [debug] 13267#0: *69 try to use file: "/test.html" "/var/www/test.html" 2011/05/06 12:54:09 [debug] 13267#0: *69 try file uri: "/test.html" 2011/05/06 12:54:09 [debug] 13267#0: *69 content phase: 12 2011/05/06 12:54:09 [debug] 13267#0: *69 content phase: 13 2011/05/06 12:54:09 [debug] 13267#0: *69 content phase: 14 2011/05/06 12:54:09 [debug] 13267#0: *69 content phase: 15 2011/05/06 12:54:09 [debug] 13267#0: *69 content phase: 16 2011/05/06 12:54:09 [debug] 13267#0: *69 http filename: "/var/www/test.html" 2011/05/06 12:54:09 [debug] 13267#0: *69 add cleanup: 0000000001C0B638 2011/05/06 12:54:09 [debug] 13267#0: *69 http static fd: 18 2011/05/06 12:54:09 [debug] 13267#0: *69 http set discard body 2011/05/06 12:54:09 [debug] 13267#0: *69 http ims:1304706966 lm:1304706966 2011/05/06 12:54:09 [debug] 13267#0: *69 HTTP/1.1 304 Not Modified Server: nginx Date: Fri, 06 May 2011 18:54:09 GMT Last-Modified: Fri, 06 May 2011 18:36:06 GMT Connection: keep-alive 2011/05/06 12:54:09 [debug] 13267#0: *69 write new buf t:1 f:0 0000000001C0B7D0, pos 0000000001C0B7D0, size: 151 file: 0, size: 0 2011/05/06 12:54:09 [debug] 13267#0: *69 http write filter: l:1 f:0 s:151 2011/05/06 12:54:09 [debug] 13267#0: *69 http write filter limit 0 2011/05/06 12:54:09 [debug] 13267#0: *69 writev: 151 2011/05/06 12:54:09 [debug] 13267#0: *69 http write filter 0000000000000000 2011/05/06 12:54:09 [debug] 13267#0: *69 http finalize request: 0, "/sparkle/test.html?" a:1, c:1 2011/05/06 12:54:09 [debug] 13267#0: *69 set http keepalive handler 2011/05/06 12:54:09 [debug] 13267#0: *69 http close request 2011/05/06 12:54:09 [debug] 13267#0: *69 http log handler 2011/05/06 12:54:09 [debug] 13267#0: *69 run cleanup: 0000000001C0B638 2011/05/06 12:54:09 [debug] 13267#0: *69 file cleanup: fd:18 2011/05/06 12:54:09 [debug] 13267#0: *69 free: 0000000001C0AA40, unused: 273 2011/05/06 12:54:09 [debug] 13267#0: *69 event timer add: 17: 2000:1304708051332 2011/05/06 12:54:09 [debug] 13267#0: *69 free: 00000000019EEE70 2011/05/06 12:54:09 [debug] 13267#0: *69 free: 00000000019E0710 2011/05/06 12:54:09 [debug] 13267#0: *69 hc free: 0000000000000000 0 2011/05/06 12:54:09 [debug] 13267#0: *69 hc busy: 0000000000000000 0 2011/05/06 12:54:09 [debug] 13267#0: *69 tcp_nodelay 2011/05/06 12:54:09 [debug] 13267#0: *69 reusable connection: 1 2011/05/06 12:54:09 [debug] 13267#0: *69 post event 00000000019EE768 2011/05/06 12:54:09 [debug] 13267#0: *69 delete posted event 00000000019EE768 2011/05/06 12:54:09 [debug] 13267#0: *69 http keepalive handler 2011/05/06 12:54:09 [debug] 13267#0: *69 malloc: 00000000019E0710:1024 2011/05/06 12:54:09 [debug] 13267#0: *69 recv: fd:17 -1 of 1024 2011/05/06 12:54:09 [debug] 13267#0: *69 recv() not ready (11: Resource temporarily unavailable) 2011/05/06 12:54:11 [debug] 13267#0: *69 event timer del: 17: 1304708051332 2011/05/06 12:54:11 [debug] 13267#0: *69 http keepalive handler 2011/05/06 12:54:11 [debug] 13267#0: *69 close http connection: 17 2011/05/06 12:54:11 [debug] 13267#0: *69 reusable connection: 0 2011/05/06 12:54:11 [debug] 13267#0: *69 free: 00000000019E0710 2011/05/06 12:54:11 [debug] 13267#0: *69 free: 0000000000000000 2011/05/06 12:54:11 [debug] 13267#0: *69 free: 0000000001B9AC50, unused: 8 2011/05/06 12:54:11 [debug] 13267#0: *69 free: 0000000001B9B460, unused: 128 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,196131,196167#msg-196167 From igor at sysoev.ru Fri May 6 23:00:10 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 6 May 2011 23:00:10 +0400 Subject: Long URLs cause nginx to hang In-Reply-To: <9383ec9105c69a6fb02fbfbd183e9af9.NginxMailingListEnglish@forum.nginx.org> References: <16d8c9361e848788e6d2e07ecc8596db.NginxMailingListEnglish@forum.nginx.org> <9383ec9105c69a6fb02fbfbd183e9af9.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110506190009.GC30428@sysoev.ru> On Fri, May 06, 2011 at 02:56:10PM -0400, uid_b wrote: > I get 2 different outputs, depending on whether the connection is SSL or > not > 2011/05/06 12:54:09 [debug] 13267#0: *69 http header: "User-Agent: > Mozilla/5.0 (X11; Linux x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1" > 2011/05/06 12:54:09 [debug] 13267#0: *69 http header: "Accept: > text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" Did you try other browser ? -- Igor Sysoev From nginx-forum at nginx.us Fri May 6 23:14:22 2011 From: nginx-forum at nginx.us (uid_b) Date: Fri, 06 May 2011 15:14:22 -0400 Subject: Long URLs cause nginx to hang In-Reply-To: <20110506190009.GC30428@sysoev.ru> References: <20110506190009.GC30428@sysoev.ru> Message-ID: Igor Sysoev Wrote: ------------------------------------------------------- > Did you try other browser ? Yes, same message from both Firefox 4.0.1 and Chrome 11.0 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,196131,196171#msg-196171 From igor at sysoev.ru Fri May 6 23:27:28 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 6 May 2011 23:27:28 +0400 Subject: Long URLs cause nginx to hang In-Reply-To: <9383ec9105c69a6fb02fbfbd183e9af9.NginxMailingListEnglish@forum.nginx.org> References: <16d8c9361e848788e6d2e07ecc8596db.NginxMailingListEnglish@forum.nginx.org> <9383ec9105c69a6fb02fbfbd183e9af9.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110506192728.GD30428@sysoev.ru> On Fri, May 06, 2011 at 02:56:10PM -0400, uid_b wrote: > I get 2 different outputs, depending on whether the connection is SSL or > not > > Non-SSL: > 2011/05/06 12:52:44 [debug] 13267#0: *48 accept: 192.168.10.21 fd:3 > 2011/05/06 12:52:44 [debug] 13267#0: *48 event timer add: 3: > 120000:1304708084457 > 2011/05/06 12:52:44 [debug] 13267#0: *48 epoll add event: fd:3 op:1 > ev:80000001 nginx does not receive any data and it should close connection after 120s. Did you run tcpdump on server side ? -- Igor Sysoev From nginx-forum at nginx.us Fri May 6 23:39:50 2011 From: nginx-forum at nginx.us (uid_b) Date: Fri, 06 May 2011 15:39:50 -0400 Subject: Long URLs cause nginx to hang In-Reply-To: References: <20110506190009.GC30428@sysoev.ru> Message-ID: This appears to be an issue with our VPN, I have no idea why everything works except for massive URL's but I don't think it's related to nginx in any way. Thanks for your help! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,196131,196177#msg-196177 From nginx-forum at nginx.us Fri May 6 23:50:08 2011 From: nginx-forum at nginx.us (TECK) Date: Fri, 06 May 2011 15:50:08 -0400 Subject: MySQL and Nginx mystery In-Reply-To: <371f900423de05e1a7d49f9888dcfe64.NginxMailingListEnglish@forum.nginx.org> References: <371f900423de05e1a7d49f9888dcfe64.NginxMailingListEnglish@forum.nginx.org> Message-ID: <1644bcfa3d142f1496577fc567ace985.NginxMailingListEnglish@forum.nginx.org> What I actually try to do is: force Nginx to show one IP to the MySQL server, no matter on what server the user is. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,196165,196181#msg-196181 From igor at sysoev.ru Fri May 6 23:51:58 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 6 May 2011 23:51:58 +0400 Subject: Long URLs cause nginx to hang In-Reply-To: References: <20110506190009.GC30428@sysoev.ru> Message-ID: <20110506195158.GA40054@sysoev.ru> On Fri, May 06, 2011 at 03:39:50PM -0400, uid_b wrote: > This appears to be an issue with our VPN, I have no idea why everything > works except for massive URL's but I don't think it's related to nginx > in any way. Try to search for "path mtu discovery vpn". -- Igor Sysoev From francis at daoine.org Sat May 7 01:06:26 2011 From: francis at daoine.org (Francis Daly) Date: Fri, 6 May 2011 22:06:26 +0100 Subject: MySQL and Nginx mystery In-Reply-To: <1644bcfa3d142f1496577fc567ace985.NginxMailingListEnglish@forum.nginx.org> References: <371f900423de05e1a7d49f9888dcfe64.NginxMailingListEnglish@forum.nginx.org> <1644bcfa3d142f1496577fc567ace985.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110506210626.GD12564@craic.sysops.org> On Fri, May 06, 2011 at 03:50:08PM -0400, TECK wrote: Hi there, > What I actually try to do is: force Nginx to show one IP to the MySQL > server, no matter on what server the user is. In your setup, nginx isn't talking to mysql at all. It's the fastcgi server that runs the php code that connects to mysql. So you'll want to look there for the resolution. Good luck, f -- Francis Daly francis at daoine.org From nginx-forum at nginx.us Sat May 7 16:49:43 2011 From: nginx-forum at nginx.us (bluescreen303) Date: Sat, 07 May 2011 08:49:43 -0400 Subject: proxy caching Message-ID: <4c8ed01f5f8401ff4d3e3634bc42488a.NginxMailingListEnglish@forum.nginx.org> Hi all, I would like to use nginx to cache some responses from my backends. There are basically 2 types of responses I would like to cache. - public images that never expire - private content The first one was easy, got that working already. Since my application uses timestamps in the html when referring to images, changes to them will be instantly picked up. The second one is way harder. Responses can become quite large (1 upto 10Mb). My backend application is putting etags on the responses so it can return 304s if nothing changed. Also, it puts a 5min max-age cache-control on it, Lastly, responses are marked private, because they are behind http basic authentication (handled by the backend app). What I would like nginx to do is the following: It should store the first response for a certain url, using the current http auth in the key (so it won't accidentally become publicly available). If a second request comes in for the same url with the same http auth within 5 minutes: serve from cache. If a second request comes in for the same url with the same http auth _after_ 5 mintutes: ask backend using the if-not-modified header. - if modified, store the new response. - if 304 not modified, respond from cache, update cache to be valid for 5 minutes again. If a request comes in for the same url but with other http auth: ignore cache and ask backend. The http auth stuff seems solvable by using the http auth in the cache_key. The other 2 things I would like to solve are: - I can't find clear info about nginx's handling of etag and if-not-modified. Will it work as described above out-of-the-box? It's especially important that nginx uses if-not-modified when querying the backend, even if the client request itself didn't contain it. Ofcourse if the client request did include it, it should receive a nice 304 too. - The backend sends Cache-Control: private for these responses. I would like nginx to cache them though. Ignoring the Cache-Control header doesn't seem to work (because without cache-control at all, caching seems disabled) Another option might be to have the backend set cache-control to public and have nginx set it back to private, but that sounds a bit hacky. Does anyone have any suggestions about how to proceed? Thanks a lot! Mathijs Posted at Nginx Forum: http://forum.nginx.org/read.php?2,196280,196280#msg-196280 From mdounin at mdounin.ru Sun May 8 02:34:23 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 8 May 2011 02:34:23 +0400 Subject: empty reply from server In-Reply-To: <4cd88446bdeea09b413fae442fa115e7.NginxMailingListEnglish@forum.nginx.org> References: <4cd88446bdeea09b413fae442fa115e7.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110507223423.GC42265@mdounin.ru> Hello! On Fri, May 06, 2011 at 09:38:46AM -0400, yellowbox9 wrote: > I'm setting up a new nginx environment and I'm having issues with 404's. > When I use curl to request a file that I know does not exist, nginx > responds back with an empty reply.... I would prefer a 404 not found > with the correct http status code. You will be surprised, but nginx returns 404 in such cases by default. > My config: > > user nobody; > worker_processes 4; > worker_rlimit_nofile 8192; > events > { > worker_connections 4096; > } > > http > { > include mime.types; > default_type text/plain; > log_format nn '$host $remote_addr - $remote_user [$time_local] > ' '"$request" $status $bytes_sent ' '"$http_referer" > "$http_user_agent"'; > access_log /opt/nginx/logs/access.log nn; > error_log /opt/nginx/logs/error.log; It's good idea to specify error_log at *global* level, not http. When defined at http level it will be only used for http-related problems, but not for generic problems. E.g. with your config information about abnormally terminated workers won't reach error_log you specified, but will go to compiled-in default error log instead. > sendfile on; > keepalive_timeout 0; > server > { > listen 80 default; > root /opt/nginx/html/; > index index.html index.htm index.php index.php5; > include /opt/nginx/conf/location_php.conf; Please show contents of the included file. > } > include /opt/nginx/conf/vhosts/*.conf; And please show contents of these includes, if there are any. > } > > The html root dir: > > bash> ls /opt/nginx/html/ > 404.html 50x.html empty.html foobar index.html ping > > The curl request: > > curl -v http://localhost/index.html2 > * About to connect() to localhost port 80 > * Trying 127.0.0.1... connected > * Connected to localhost (127.0.0.1) port 80 > > GET /index.html2 HTTP/1.1 > > User-Agent: curl/7.15.5 (i386-redhat-linux-gnu) libcurl/7.15.5 > OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 > > Host: localhost > > Accept: */* > > > * Empty reply from server > * Connection #0 to host localhost left intact > curl: (52) Empty reply from server > * Closing connection #0 > > The access log: > localhost 127.0.0.1 - - [06/May/2011:09:35:17 -0400] "GET /index.html2 > HTTP/1.1" 200 0 "-" "curl/7.15.5 (i386-redhat-linux-gnu) libcurl/7.15.5 > OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5" - For some reason returning http > status code 200? > > The error log: > 2011/05/06 09:35:17 [error] 9879#0: *9312 open() > "/opt/nginx/html/index.html2" failed (2: No such file or directory), > client: 127.0.0.1, server: , request: "GET /index.html2 HTTP/1.1", host: > "localhost" > > I don't understand what I'm doing wrong here... any thoughts? Empty response indicate either "return 444" somewhere in your config or some error occured (and it's impossible to return error to the client). Status 200 in your access log indicate that your set some error_page processing somewhere in your config. It's impossible to say anything for sure from information you provided (basically there is no full error log, and no full config), but I assume you did something like error_page 404 =200 /error; location /error { return 444; } which will lead to the exactly the same results as you described. Maxim Dounin From mdounin at mdounin.ru Sun May 8 03:29:31 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sun, 8 May 2011 03:29:31 +0400 Subject: proxy caching In-Reply-To: <4c8ed01f5f8401ff4d3e3634bc42488a.NginxMailingListEnglish@forum.nginx.org> References: <4c8ed01f5f8401ff4d3e3634bc42488a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110507232930.GD42265@mdounin.ru> Hello! On Sat, May 07, 2011 at 08:49:43AM -0400, bluescreen303 wrote: > Hi all, > > I would like to use nginx to cache some responses from my backends. > There are basically 2 types of responses I would like to cache. > > - public images that never expire > - private content > > The first one was easy, got that working already. Since my application > uses timestamps in the html when referring to images, changes to them > will be instantly picked up. > > The second one is way harder. > Responses can become quite large (1 upto 10Mb). > My backend application is putting etags on the responses so it can > return 304s if nothing changed. > Also, it puts a 5min max-age cache-control on it, > Lastly, responses are marked private, because they are behind http basic > authentication (handled by the backend app). > > What I would like nginx to do is the following: > It should store the first response for a certain url, using the current > http auth in the key (so it won't accidentally become publicly > available). > If a second request comes in for the same url with the same http auth > within 5 minutes: serve from cache. > If a second request comes in for the same url with the same http auth > _after_ 5 mintutes: ask backend using the if-not-modified header. > - if modified, store the new response. > - if 304 not modified, respond from cache, update cache to be valid for > 5 minutes again. > If a request comes in for the same url but with other http auth: ignore > cache and ask backend. > > The http auth stuff seems solvable by using the http auth in the > cache_key. > The other 2 things I would like to solve are: > > - I can't find clear info about nginx's handling of etag and > if-not-modified. Will it work as described above out-of-the-box? > It's especially important that nginx uses if-not-modified when querying > the backend, even if the client request itself didn't contain it. > Ofcourse if the client request did include it, it should receive a nice > 304 too. Right now nginx can't use conditional requests to refresh cache. > - The backend sends Cache-Control: private for these responses. I would > like nginx to cache them though. > Ignoring the Cache-Control header doesn't seem to work (because without > cache-control at all, caching seems disabled) > Another option might be to have the backend set cache-control to public > and have nginx set it back to private, but that sounds a bit hacky. Solution is to ignore Cache-Control header and enable caching explicitly with proxy_cache_valid directive. Maxim Dounin From luky-37 at hotmail.com Sun May 8 20:17:11 2011 From: luky-37 at hotmail.com (Lukas Tribus) Date: Sun, 8 May 2011 18:17:11 +0200 Subject: proxy caching In-Reply-To: <20110507232930.GD42265@mdounin.ru> References: <4c8ed01f5f8401ff4d3e3634bc42488a.NginxMailingListEnglish@forum.nginx.org>, <20110507232930.GD42265@mdounin.ru> Message-ID: Hi, give varnish [1] a look, its probably better suited for such a scenario. [1] http://www.varnish-cache.org/ > Date: Sun, 8 May 2011 03:29:31 +0400 > From: mdounin at mdounin.ru > To: nginx at nginx.org > Subject: Re: proxy caching > > Hello! > > On Sat, May 07, 2011 at 08:49:43AM -0400, bluescreen303 wrote: > > > Hi all, > > > > I would like to use nginx to cache some responses from my backends. > > There are basically 2 types of responses I would like to cache. > > > > - public images that never expire > > - private content > > > > The first one was easy, got that working already. Since my application > > uses timestamps in the html when referring to images, changes to them > > will be instantly picked up. > > > > The second one is way harder. > > Responses can become quite large (1 upto 10Mb). > > My backend application is putting etags on the responses so it can > > return 304s if nothing changed. > > Also, it puts a 5min max-age cache-control on it, > > Lastly, responses are marked private, because they are behind http basic > > authentication (handled by the backend app). > > > > What I would like nginx to do is the following: > > It should store the first response for a certain url, using the current > > http auth in the key (so it won't accidentally become publicly > > available). > > If a second request comes in for the same url with the same http auth > > within 5 minutes: serve from cache. > > If a second request comes in for the same url with the same http auth > > _after_ 5 mintutes: ask backend using the if-not-modified header. > > - if modified, store the new response. > > - if 304 not modified, respond from cache, update cache to be valid for > > 5 minutes again. > > If a request comes in for the same url but with other http auth: ignore > > cache and ask backend. > > > > The http auth stuff seems solvable by using the http auth in the > > cache_key. > > The other 2 things I would like to solve are: > > > > - I can't find clear info about nginx's handling of etag and > > if-not-modified. Will it work as described above out-of-the-box? > > It's especially important that nginx uses if-not-modified when querying > > the backend, even if the client request itself didn't contain it. > > Ofcourse if the client request did include it, it should receive a nice > > 304 too. > > Right now nginx can't use conditional requests to refresh cache. > > > - The backend sends Cache-Control: private for these responses. I would > > like nginx to cache them though. > > Ignoring the Cache-Control header doesn't seem to work (because without > > cache-control at all, caching seems disabled) > > Another option might be to have the backend set cache-control to public > > and have nginx set it back to private, but that sounds a bit hacky. > > Solution is to ignore Cache-Control header and enable caching > explicitly with proxy_cache_valid directive. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sun May 8 23:15:28 2011 From: nginx-forum at nginx.us (zildjohn01) Date: Sun, 08 May 2011 15:15:28 -0400 Subject: nginx silently drops response body of POST depending on its length Message-ID: <221afc752b74444b2aa51a8b264f930c.NginxMailingListEnglish@forum.nginx.org> I've come across an incredibly weird problem with POST responses using nginx 1.0.1 and uWSGI 0.9.7.2 on CentOS 5.6. uWSGI successfully sends the response body to nginx, but nginx seems to ignore it if both (1) the request method is POST, and (2) the response length is less than 4052 bytes. The issue doesn't occur when serving directly using `uwsgi --http`, so I'm pretty sure the problem is something to do with nginx. To explain things in code, this Python results in the desired response: ....def app_uwsgi(environ, start_response): ........start_response('200 OK', [('Content-type', 'text/html')]) ........return [b'x' * 4052] while this results in zero bytes being sent to the client for POST requests: ....def app_uwsgi(environ, start_response): ........start_response('200 OK', [('Content-type', 'text/html')]) ........return [b'x' * 4051] I stripped down to a minimal nginx.conf, and the issue still occurs: ....events { ........worker_connections 1024; ....} ....http { ........upstream uwsgi_connect { ............server 127.0.0.1:39275; ........} ........server { ............listen 20101; ............server_name domain.net; ............location / { ................uwsgi_pass uwsgi_connect; ................include uwsgi_params; ............} ........} ....} Does anyone have any clue what could be causing this behavior? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,196581,196581#msg-196581 From nginx-forum at nginx.us Mon May 9 07:12:29 2011 From: nginx-forum at nginx.us (bigplum) Date: Sun, 08 May 2011 23:12:29 -0400 Subject: nginx proxying do not locally save/buffer uploaded files? In-Reply-To: <20110504211549.GL32595@reaktio.net> References: <20110504211549.GL32595@reaktio.net> Message-ID: If we set proxy_store and proxy_cache to off, will nginx cache uploaded files? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,195656,196629#msg-196629 From roberto at unbit.it Mon May 9 09:41:42 2011 From: roberto at unbit.it (Roberto De Ioris) Date: Mon, 9 May 2011 07:41:42 +0200 (CEST) Subject: nginx silently drops response body of POST depending on its length In-Reply-To: <221afc752b74444b2aa51a8b264f930c.NginxMailingListEnglish@forum.nginx. org> References: <221afc752b74444b2aa51a8b264f930c.NginxMailingListEnglish@forum.nginx.org> Message-ID: > I've come across an incredibly weird problem with POST responses using > nginx 1.0.1 and uWSGI 0.9.7.2 on CentOS 5.6. > > uWSGI successfully sends the response body to nginx, but nginx seems to > ignore it if both (1) the request method is POST, and (2) the response > length is less than 4052 bytes. The issue doesn't occur when serving > directly using `uwsgi --http`, so I'm pretty sure the problem is > something to do with nginx. > > To explain things in code, this Python results in the desired response: > > ....def app_uwsgi(environ, start_response): > ........start_response('200 OK', [('Content-type', 'text/html')]) > ........return [b'x' * 4052] > > while this results in zero bytes being sent to the client for POST > requests: > > ....def app_uwsgi(environ, start_response): > ........start_response('200 OK', [('Content-type', 'text/html')]) > ........return [b'x' * 4051] > > I stripped down to a minimal nginx.conf, and the issue still occurs: > > ....events { > ........worker_connections 1024; > ....} > > ....http { > ........upstream uwsgi_connect { > ............server 127.0.0.1:39275; > ........} > > ........server { > ............listen 20101; > ............server_name domain.net; > > ............location / { > ................uwsgi_pass uwsgi_connect; > ................include uwsgi_params; > ............} > ........} > ....} > > Be sure to read POST body in your WSGI app if Content-Length > 0, otherwise your socket queue will get clobbered (nginx will receive a close when there is still data available in the queue) -- Roberto De Ioris http://unbit.it From jeffrpang at gmail.com Mon May 9 10:18:09 2011 From: jeffrpang at gmail.com (Jeff Pang) Date: Mon, 9 May 2011 14:18:09 +0800 Subject: server_name for https Message-ID: Hello, Since HTTPS doesn't support vhost, shall we have the need to put the server_name command in the server section? for example, server { listen 443; server_name xxx.example.com; .... } Thanks. -- Jeff Pang www.DNSbed.com From pasik at iki.fi Mon May 9 10:34:07 2011 From: pasik at iki.fi (Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?=) Date: Mon, 9 May 2011 09:34:07 +0300 Subject: nginx proxying do not locally save/buffer uploaded files? In-Reply-To: References: <20110504211549.GL32595@reaktio.net> Message-ID: <20110509063407.GZ32595@reaktio.net> On Sun, May 08, 2011 at 11:12:29PM -0400, bigplum wrote: > If we set proxy_store and proxy_cache to off, will nginx cache uploaded > files? > proxy_cache only mentions "backend" .. so I think it's not for uploads.. -- Pasi From cedric.jeanneret at camptocamp.com Mon May 9 11:06:27 2011 From: cedric.jeanneret at camptocamp.com (Cedric Jeanneret) Date: Mon, 9 May 2011 09:06:27 +0200 Subject: server_name for https In-Reply-To: References: Message-ID: <20110509090627.68905d0d@cholatse.wrk.lsn.camptocamp.com> On Mon, 9 May 2011 14:18:09 +0800 Jeff Pang wrote: > Hello, > > Since HTTPS doesn't support vhost, shall we have the need to put the > server_name command in the server section? for example, > > server { > listen 443; > server_name xxx.example.com; > .... > } > > Thanks. > > o_O since when does HTTPS not support vhosts ? the only problem is when having multiple SSL vhosts on the same IP - the certificate has to cover all those vhosts. To answer your question, you shall provide: server_name $_; it's the default vhost Cheers, C. -- C?dric Jeanneret | System Administrator 021 619 10 32 | Camptocamp SA cedric.jeanneret at camptocamp.com | PSE-A / EPFL www.camptocamp.com | www.github.com/camptocamp -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From jeffrpang at gmail.com Mon May 9 11:39:11 2011 From: jeffrpang at gmail.com (Jeff Pang) Date: Mon, 9 May 2011 15:39:11 +0800 Subject: server_name for https In-Reply-To: <20110509090627.68905d0d@cholatse.wrk.lsn.camptocamp.com> References: <20110509090627.68905d0d@cholatse.wrk.lsn.camptocamp.com> Message-ID: 2011/5/9 Cedric Jeanneret : > On Mon, 9 May 2011 14:18:09 +0800 > Jeff Pang wrote: > >> Hello, >> >> Since HTTPS doesn't support vhost, shall we have the need to put the >> server_name command in the server section? for example, >> >> ? ? ? ? ?server { >> ? ? ? ? ? ? ? ? listen ? ? ? 443; >> ? ? ? ? ? ? ? ? server_name ?xxx.example.com; >> ? ? ? ? ? ? ? ? .... >> ? ? ? ? ?} >> >> Thanks. >> >> > > o_O since when does HTTPS not support vhosts ? > > the only problem is when having multiple SSL vhosts on the same IP - the certificate has to cover all those vhosts. > > To answer your question, you shall provide: > server_name $_; > > it's the default vhost > OK That's right thanks. I have misunderstood the SSL Proxy maybe, now I got it. -- Jeff Pang www.DNSbed.com From Richard.Kearsley at m247.com Mon May 9 13:33:18 2011 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Mon, 9 May 2011 09:33:18 +0000 Subject: aio info In-Reply-To: <20110506130030.GE3100@sysoev.ru> References: <20110505071212.GA36559@sysoev.ru> <20110506105017.GD3100@sysoev.ru> <20110506130030.GE3100@sysoev.ru> Message-ID: Running nginx on freebsd 8.2 with 16 workers and aio on, when the server encounters heavy writes, all processes are in D state Aio queue is way below system/process limit A request for small file (said file will be in fs buffer/cache) every second varies wildly from 1ms to over 1s >From man ps: D Marks a process in disk (or other short term, uninter-ruptible) wait. What's causing the lock? Many thanks Richard From pascal.nitsche at fansubcode.org Mon May 9 13:48:55 2011 From: pascal.nitsche at fansubcode.org (Pascal Nitsche) Date: Mon, 09 May 2011 11:48:55 +0200 Subject: server_name for https In-Reply-To: <20110509090627.68905d0d@cholatse.wrk.lsn.camptocamp.com> References: <20110509090627.68905d0d@cholatse.wrk.lsn.camptocamp.com> Message-ID: <4DC7B887.7060507@fansubcode.org> Am 09.05.2011 09:06, schrieb Cedric Jeanneret: > On Mon, 9 May 2011 14:18:09 +0800 > Jeff Pang wrote: > >> Hello, >> >> Since HTTPS doesn't support vhost, shall we have the need to put the >> server_name command in the server section? for example, >> >> server { >> listen 443; >> server_name xxx.example.com; >> .... >> } >> >> Thanks. >> >> > o_O since when does HTTPS not support vhosts ? > > the only problem is when having multiple SSL vhosts on the same IP - the certificate has to cover all those vhosts. > > To answer your question, you shall provide: > server_name $_; > > it's the default vhost > > Cheers, > > C. Even this is not needed since nginx does support SNI. http://en.wikipedia.org/wiki/Server_Name_Indication Hope this helps a bit, Pascal From nginx-forum at nginx.us Mon May 9 14:52:28 2011 From: nginx-forum at nginx.us (davidkazuhiro) Date: Mon, 09 May 2011 06:52:28 -0400 Subject: Logs in wrong order Message-ID: When I hit the nginx server with a very rapid succession of requests from multiple clients, the logs will be out of order. For example, the log times would appear like this: ... 18:10:11 ... ... 18:10:11 ... ... 18:10:11 ... ... 18:10:12 ... ... 18:10:11 ... ... 18:10:12 ... ... 18:10:11 ... ... 18:10:12 ... ... 18:10:12 ... ... 18:10:12 ... Why would this be? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,196690,196690#msg-196690 From mdounin at mdounin.ru Mon May 9 14:52:35 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 9 May 2011 14:52:35 +0400 Subject: nginx silently drops response body of POST depending on its length In-Reply-To: <221afc752b74444b2aa51a8b264f930c.NginxMailingListEnglish@forum.nginx.org> References: <221afc752b74444b2aa51a8b264f930c.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110509105235.GE42265@mdounin.ru> Hello! On Sun, May 08, 2011 at 03:15:28PM -0400, zildjohn01 wrote: > I've come across an incredibly weird problem with POST responses using > nginx 1.0.1 and uWSGI 0.9.7.2 on CentOS 5.6. > > uWSGI successfully sends the response body to nginx, but nginx seems to > ignore it if both (1) the request method is POST, and (2) the response > length is less than 4052 bytes. The issue doesn't occur when serving > directly using `uwsgi --http`, so I'm pretty sure the problem is > something to do with nginx. > > To explain things in code, this Python results in the desired response: > > ....def app_uwsgi(environ, start_response): > ........start_response('200 OK', [('Content-type', 'text/html')]) > ........return [b'x' * 4052] > > while this results in zero bytes being sent to the client for POST > requests: > > ....def app_uwsgi(environ, start_response): > ........start_response('200 OK', [('Content-type', 'text/html')]) > ........return [b'x' * 4051] > > I stripped down to a minimal nginx.conf, and the issue still occurs: > > ....events { > ........worker_connections 1024; > ....} > > ....http { > ........upstream uwsgi_connect { > ............server 127.0.0.1:39275; > ........} > > ........server { > ............listen 20101; > ............server_name domain.net; > > ............location / { > ................uwsgi_pass uwsgi_connect; > ................include uwsgi_params; > ............} > ........} > ....} > > Does anyone have any clue what could be causing this behavior? As it was already said - you have to read body of POST before sending reply. Else you'll get something like ... readv() failed (54: Connection reset by peer) while reading upstream ... in nginx error log and possibly incorrect reply (depending on various factors, including sizes and event method used). Maxim Dounin From jeffrpang at gmail.com Mon May 9 14:58:12 2011 From: jeffrpang at gmail.com (Jeff Pang) Date: Mon, 9 May 2011 18:58:12 +0800 Subject: log rotate Message-ID: Hi, Does nginx support the feature of logrotate by log4j format? log4j is rotate the log files by each date and rename the old logs with log_name.YYYY-MM-DD. Thanks. -- Jeff Pang www.DNSbed.com From mdounin at mdounin.ru Mon May 9 15:08:15 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 9 May 2011 15:08:15 +0400 Subject: Logs in wrong order In-Reply-To: References: Message-ID: <20110509110815.GG42265@mdounin.ru> Hello! On Mon, May 09, 2011 at 06:52:28AM -0400, davidkazuhiro wrote: > When I hit the nginx server with a very rapid succession of requests > from multiple clients, the logs will be out of order. For example, the > log times would appear like this: > > ... 18:10:11 ... > ... 18:10:11 ... > ... 18:10:11 ... > ... 18:10:12 ... > ... 18:10:11 ... > ... 18:10:12 ... > ... 18:10:11 ... > ... 18:10:12 ... > ... 18:10:12 ... > ... 18:10:12 ... > > Why would this be? Time in different nginx worker processes may be slightly different as nginx only updates time once per event loop iteration (or even less frequently if timer_resolution set). This in turn results in out-of-order times in logs you see when requests from different workers are logged. Similar effect may be also seen when using log buffering (though in this case you'll see blocks with successive times up to log buffer size, not individual lines). Maxim Dounin From mdounin at mdounin.ru Mon May 9 15:11:24 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 9 May 2011 15:11:24 +0400 Subject: log rotate In-Reply-To: References: Message-ID: <20110509111124.GH42265@mdounin.ru> Hello! On Mon, May 09, 2011 at 06:58:12PM +0800, Jeff Pang wrote: > Hi, > > Does nginx support the feature of logrotate by log4j format? > log4j is rotate the log files by each date and rename the old logs > with log_name.YYYY-MM-DD. nginx doesn't do any log rotation by itself. You have to rename logs yourself (or with your favorite logrotate tool) and send USR1 signal to nginx to instruct it to reopen log files. Maxim Dounin From mdounin at mdounin.ru Mon May 9 15:21:49 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 9 May 2011 15:21:49 +0400 Subject: aio info In-Reply-To: References: <20110505071212.GA36559@sysoev.ru> <20110506105017.GD3100@sysoev.ru> <20110506130030.GE3100@sysoev.ru> Message-ID: <20110509112149.GI42265@mdounin.ru> Hello! On Mon, May 09, 2011 at 09:33:18AM +0000, Richard Kearsley wrote: > Running nginx on freebsd 8.2 with 16 workers and aio on, when the server encounters heavy writes, all processes are in D state > Aio queue is way below system/process limit > A request for small file (said file will be in fs buffer/cache) every second varies wildly from 1ms to over 1s > > >From man ps: > D Marks a process in disk (or other short term, uninter-ruptible) wait. > > What's causing the lock? You may want to look at WCHAN instead, it should contain more information. Please note that AIO interface only allows to do async reads, but open()/stat()/... are still blocking. This may be a problem if you've run out of vnodes (sysctl kern.maxvnodes) or there are other reasons NAMEI lookups can't be effectively cached by OS. Maxim Dounin From nginx-forum at nginx.us Mon May 9 16:13:39 2011 From: nginx-forum at nginx.us (davidkazuhiro) Date: Mon, 09 May 2011 08:13:39 -0400 Subject: Logs in wrong order In-Reply-To: <20110509110815.GG42265@mdounin.ru> References: <20110509110815.GG42265@mdounin.ru> Message-ID: <0aaee937b2ca97d2ea64d4786bdb7ac8.NginxMailingListEnglish@forum.nginx.org> Oh I see, tricky. How is an event loop defined? Is there a value definable in nginx.conf which can shorten the event loop? Or can I just increase timer resolution to a really high number to make the log times more accurate? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,196690,196707#msg-196707 From lists at ruby-forum.com Mon May 9 18:17:25 2011 From: lists at ruby-forum.com (Maik Unger) Date: Mon, 09 May 2011 16:17:25 +0200 Subject: Expierence nGinx with Typo3 Caching Message-ID: <9eb8c174d8244c592e22be2170d99653@ruby-forum.com> Hello Everybody, Does anybody have expierence with nginx and typo3 caching? I have a very strange problem with the caching on of our customers sites. They made changes in typo3. On the first domain first.domain.de the changes will take their effect. When the customer will make another changes, then the nginx will show the old cache. What is here the problem? Maybe the proxy_cache_key? Best Regards, Maik -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon May 9 19:53:07 2011 From: lists at ruby-forum.com (John Travolota) Date: Mon, 09 May 2011 17:53:07 +0200 Subject: How to redirect non anonymous proxy traffic? Message-ID: <8078670c1a98c6521834d738a287afce@ruby-forum.com> I know it's something with HTTP_X_FORWARDED directive but not sure how to make it work. I need detection of it and then redirect to set URL. -- Posted via http://www.ruby-forum.com/. From nginx-forum at nginx.us Mon May 9 20:19:52 2011 From: nginx-forum at nginx.us (zildjohn01) Date: Mon, 09 May 2011 12:19:52 -0400 Subject: nginx silently drops response body of POST depending on its length In-Reply-To: <221afc752b74444b2aa51a8b264f930c.NginxMailingListEnglish@forum.nginx.org> References: <221afc752b74444b2aa51a8b264f930c.NginxMailingListEnglish@forum.nginx.org> Message-ID: <6982d9bbdfc2231e83c84ca123ab028e.NginxMailingListEnglish@forum.nginx.org> Thanks, that helped point me to the issue. It turns out the problem was that I didn't pass --pep3333-input to uWSGI, so it was converting all CRLFs to LFs in the request body, so CONTENT_LENGTH didn't match the data length. Passing that flag to uWSGI made it pass the raw stream to my app and solved the problem. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,196581,196761#msg-196761 From ionathan at gmail.com Mon May 9 20:42:41 2011 From: ionathan at gmail.com (Jonathan Leibiusky) Date: Mon, 9 May 2011 13:42:41 -0300 Subject: proxy_next_upstream and POSTs Message-ID: Hi! Nginx is great and the way it handles upstream and failed server as well! I would just like to avoid retrying request when they are POSTs, as POSTs are no idempotent and my backend can't handle duplicated POSTs right now. So I started to mess around with the code. What I have in mind is to create a module that will change the behavior of proxy_next_upstream by just checking that http method != POST. I believe it supposed to be really simple. So a couple of questions for those who are into nginx source code: 1. Is there any good article, blog post, etc, that explain how to create and test a module? 2. Any good advice on how I should do it? I was thinking on adding the validation somewhere in ngx_http_upstream_test_next (ngx_http_upstream.c), something like: if (r->method == NGX_HTTP_POST) { return NGX_DECLINED; } If this is OK, how could I do this from a module? So when someone compiles nginx with this module, he'll have this behavior instead of the standard one? Sorry if my questions are dumb. Jonathan -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Mon May 9 21:18:34 2011 From: nginx-forum at nginx.us (yellowbox9) Date: Mon, 09 May 2011 13:18:34 -0400 Subject: empty reply from server In-Reply-To: <4cd88446bdeea09b413fae442fa115e7.NginxMailingListEnglish@forum.nginx.org> References: <4cd88446bdeea09b413fae442fa115e7.NginxMailingListEnglish@forum.nginx.org> Message-ID: <8977fb6f50245565eaa9b33541fa9413.NginxMailingListEnglish@forum.nginx.org> Nothing is in the vhosts dir.... and I'm not doing anything like : error_page 404 =200 /error; location /error { return 444; } Not Posted at Nginx Forum: http://forum.nginx.org/read.php?2,196075,196789#msg-196789 From ionathan at gmail.com Tue May 10 02:37:36 2011 From: ionathan at gmail.com (Jonathan Leibiusky) Date: Mon, 9 May 2011 19:37:36 -0300 Subject: proxy_next_upstream and POSTs In-Reply-To: References: Message-ID: I read some modules out there and could manage to write a custom module that will do the job. I have some doubts though. How can I call the original upstream module from my own upstream module? I don't want to replace it. I think the magic might go here: ngx_http_upstream_init__peer method. Is that right? Is there any example that I can use? Thanks! Jonathan On Mon, May 9, 2011 at 1:42 PM, Jonathan Leibiusky wrote: > Hi! > Nginx is great and the way it handles upstream and failed server as well! I > would just like to avoid retrying request when they are POSTs, as POSTs are > no idempotent and my backend can't handle duplicated POSTs right now. > So I started to mess around with the code. What I have in mind is to create > a module that will change the behavior of proxy_next_upstream by just > checking that http method != POST. > I believe it supposed to be really simple. > So a couple of questions for those who are into nginx source code: > 1. Is there any good article, blog post, etc, that explain how to create > and test a module? > 2. Any good advice on how I should do it? I was thinking on adding the > validation somewhere in ngx_http_upstream_test_next (ngx_http_upstream.c), > something like: > if (r->method == NGX_HTTP_POST) { > return NGX_DECLINED; > } > > If this is OK, how could I do this from a module? So when someone compiles > nginx with this module, he'll have this behavior instead of the standard > one? > > Sorry if my questions are dumb. > > Jonathan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From member at linkedin.com Tue May 10 10:46:50 2011 From: member at linkedin.com (=?UTF-8?Q?=E5=AD=A6=E9=B9=8F_=E6=9D=8E_via_LinkedIn?=) Date: Tue, 10 May 2011 06:46:50 +0000 (UTC) Subject: Invitation to connect on LinkedIn Message-ID: <169429782.5059641.1305010010543.JavaMail.app@ela4-bed79.prod> LinkedIn ------------?? ? requested to add you as a connection on LinkedIn: ------------------------------------------ Evert, I'd like to add you to my professional network on LinkedIn. - ?? Accept invitation from ?? ? http://www.linkedin.com/e/-k9ugzs-gnih9kmm-66/vknzOax-I0d5XpARv228ODrxyY/blk/I2800928867_2/1BpC5vrmRLoRZcjkkZt5YCpnlOt3RApnhMpmdzgmhxrSNBszYOnPsSe3wOej0Me399bR1zkDwTkzBdbPwOd30MdPoQe38LrCBxbOYWrSlI/EML_comm_afe/ View invitation from ?? ? http://www.linkedin.com/e/-k9ugzs-gnih9kmm-66/vknzOax-I0d5XpARv228ODrxyY/blk/I2800928867_2/39vdPoUe38Vc30UcAALqnpPbOYWrSlI/svi/ ------------------------------------------ DID YOU KNOW your LinkedIn profile helps you control your public image when people search for you? Setting your profile as public means your LinkedIn profile will come up when people enter your name in leading search engines. Take control of your image! http://www.linkedin.com/e/-k9ugzs-gnih9kmm-66/ewp/inv-22/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From antoine.bonavita at gmail.com Tue May 10 11:22:27 2011 From: antoine.bonavita at gmail.com (Antoine Bonavita) Date: Tue, 10 May 2011 09:22:27 +0200 Subject: proxy_next_upstream and POSTs In-Reply-To: References: Message-ID: Hello, You might want to have a look at Evan's Miller section on proxying handlers: http://www.evanmiller.org/nginx-modules-guide.html#proxying This page is pretty much considered *the* reference for module development. Enjoy, Antoine. -- Low fare on trips to nginx land: visit http://www.nginx-discovery.com On Tue, May 10, 2011 at 12:37 AM, Jonathan Leibiusky wrote: > I read some modules out there and could manage to write a custom module that > will do the job. I have some doubts though. > How can I call the original upstream module from my own upstream module? I > don't want to replace it. > > I think the magic might go here: > ngx_http_upstream_init__peer method. Is that right? Is there > any example that I can use? > > Thanks! > > Jonathan > > On Mon, May 9, 2011 at 1:42 PM, Jonathan Leibiusky > wrote: >> >> Hi! >> Nginx is great and the way it handles upstream and failed server as well! >> I would just like to avoid retrying request when they are POSTs, as POSTs >> are no idempotent and my backend can't handle duplicated POSTs right now. >> So I started to mess around with the code. What I have in mind is to >> create a module that will change the behavior of proxy_next_upstream by just >> checking that http method != POST. >> I believe it supposed to be really simple. >> So a couple of questions for those who are into nginx source code: >> 1. Is there any good article, blog post, etc, that explain how to create >> and test a module? >> 2. Any good advice on how I should do it? I was thinking on adding the >> validation somewhere in ngx_http_upstream_test_next (ngx_http_upstream.c), >> something like: >> if (r->method == NGX_HTTP_POST) { >> ? return NGX_DECLINED; >> } >> >> If this is OK, how could I do this from a module? So when someone compiles >> nginx with this module, he'll have this behavior instead of the standard >> one? >> >> Sorry if my questions are dumb. >> >> Jonathan > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > > From grails at jmsd.co.uk Tue May 10 13:31:06 2011 From: grails at jmsd.co.uk (John Moore) Date: Tue, 10 May 2011 10:31:06 +0100 Subject: 2048 worker_connections are not enough while connecting to upstream Message-ID: <4DC905DA.7000200@jmsd.co.uk> I'm using nginx as a remote proxy server in front of some Tomcat instances, with pretty high traffic. Suddenly yesterday afternoon we started getting the error in the message subject, one I'd never seen before, and it's occurred tens of thousands of times since. Now, I've upped the worker_connections count to a much higher figure and the problem has gone away for now. But I'm concerned that it might be indicative of something else - some kind of DOS attack, maybe? What does this signify and why might we suddenly start getting it? Thanks. John From mdounin at mdounin.ru Tue May 10 14:19:22 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 10 May 2011 14:19:22 +0400 Subject: 2048 worker_connections are not enough while connecting to upstream In-Reply-To: <4DC905DA.7000200@jmsd.co.uk> References: <4DC905DA.7000200@jmsd.co.uk> Message-ID: <20110510101922.GJ42265@mdounin.ru> Hello! On Tue, May 10, 2011 at 10:31:06AM +0100, John Moore wrote: > I'm using nginx as a remote proxy server in front of some Tomcat > instances, with pretty high traffic. Suddenly yesterday afternoon we > started getting the error in the message subject, one I'd never seen > before, and it's occurred tens of thousands of times since. Now, > I've upped the worker_connections count to a much higher figure and > the problem has gone away for now. But I'm concerned that it might > be indicative of something else - some kind of DOS attack, maybe? > What does this signify and why might we suddenly start getting it? > Thanks. Without proper history graphs (use stub_status, Luke!) it's hard to say if you are under attack or just your normal load reached the bar (or your backend response time degraded and this resulted in more connections used, or your network uplink has problems and this caused more connections...). On the other hand, 2048 is pretty low, and easily reached even without keepalive. Usual production values for "high traffic" sites is over 9000. Please also note that using high worker_connections may also require tuning of your OS to allow appropriate number of file descriptors to be used. Maxim Dounin From grails at jmsd.co.uk Tue May 10 14:32:29 2011 From: grails at jmsd.co.uk (John Moore) Date: Tue, 10 May 2011 11:32:29 +0100 Subject: 2048 worker_connections are not enough while connecting to upstream In-Reply-To: <20110510101922.GJ42265@mdounin.ru> References: <4DC905DA.7000200@jmsd.co.uk> <20110510101922.GJ42265@mdounin.ru> Message-ID: <4DC9143D.3070903@jmsd.co.uk> On 10/05/11 11:19, Maxim Dounin wrote: > Hello! > > On Tue, May 10, 2011 at 10:31:06AM +0100, John Moore wrote: > > >> I'm using nginx as a remote proxy server in front of some Tomcat >> instances, with pretty high traffic. Suddenly yesterday afternoon we >> started getting the error in the message subject, one I'd never seen >> before, and it's occurred tens of thousands of times since. Now, >> I've upped the worker_connections count to a much higher figure and >> the problem has gone away for now. But I'm concerned that it might >> be indicative of something else - some kind of DOS attack, maybe? >> What does this signify and why might we suddenly start getting it? >> Thanks. >> > Without proper history graphs (use stub_status, Luke!) it's hard > to say if you are under attack or just your normal load reached > the bar (or your backend response time degraded and this resulted > in more connections used, or your network uplink has problems and > this caused more connections...). > I'll look into these. > On the other hand, 2048 is pretty low, and easily reached even > without keepalive. Usual production values for "high traffic" > sites is over 9000. > OK, I may bump it up a bit higher than the 8192 I set it as today. > Please also note that using high worker_connections may also > require tuning of your OS to allow appropriate number of file > descriptors to be used. > I made this change a while back, so we should be OK with that. Thanks for your extremely lucid help! John From igor at sysoev.ru Tue May 10 16:29:51 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 10 May 2011 16:29:51 +0400 Subject: nginx-1.0.2 Message-ID: <20110510122951.GE90700@sysoev.ru> Changes with nginx 1.0.2 10 May 2011 *) Feature: now shared zones and caches use POSIX semaphores. *) Bugfix: in the "rotate" parameter of the "image_filter" directive. Thanks to Adam Bocim. *) Bugfix: nginx could not be built on Solaris; the bug had appeared in 1.0.1. -- Igor Sysoev From ionathan at gmail.com Tue May 10 18:09:45 2011 From: ionathan at gmail.com (Jonathan Leibiusky) Date: Tue, 10 May 2011 11:09:45 -0300 Subject: proxy_next_upstream and POSTs In-Reply-To: References: Message-ID: Thanks! That guide was really useful. I almost have it done. What is missing there is how to test and maybe something even more generic. Once I finish my module I will try to write an even more basic guide to help people :) Jonathan On 5/10/11, Antoine Bonavita wrote: > Hello, > > You might want to have a look at Evan's Miller section on proxying > handlers: http://www.evanmiller.org/nginx-modules-guide.html#proxying > This page is pretty much considered *the* reference for module development. > > Enjoy, > > Antoine. > -- > Low fare on trips to nginx land: visit http://www.nginx-discovery.com > > On Tue, May 10, 2011 at 12:37 AM, Jonathan Leibiusky > wrote: >> I read some modules out there and could manage to write a custom module >> that >> will do the job. I have some doubts though. >> How can I call the original upstream module from my own upstream module? I >> don't want to replace it. >> >> I think the magic might go here: >> ngx_http_upstream_init__peer method. Is that right? Is there >> any example that I can use? >> >> Thanks! >> >> Jonathan >> >> On Mon, May 9, 2011 at 1:42 PM, Jonathan Leibiusky >> wrote: >>> >>> Hi! >>> Nginx is great and the way it handles upstream and failed server as well! >>> I would just like to avoid retrying request when they are POSTs, as POSTs >>> are no idempotent and my backend can't handle duplicated POSTs right now. >>> So I started to mess around with the code. What I have in mind is to >>> create a module that will change the behavior of proxy_next_upstream by >>> just >>> checking that http method != POST. >>> I believe it supposed to be really simple. >>> So a couple of questions for those who are into nginx source code: >>> 1. Is there any good article, blog post, etc, that explain how to create >>> and test a module? >>> 2. Any good advice on how I should do it? I was thinking on adding the >>> validation somewhere in ngx_http_upstream_test_next >>> (ngx_http_upstream.c), >>> something like: >>> if (r->method == NGX_HTTP_POST) { >>> ? return NGX_DECLINED; >>> } >>> >>> If this is OK, how could I do this from a module? So when someone >>> compiles >>> nginx with this module, he'll have this behavior instead of the standard >>> one? >>> >>> Sorry if my questions are dumb. >>> >>> Jonathan >> >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://nginx.org/mailman/listinfo/nginx >> >> > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > From piotr.sikora at frickle.com Tue May 10 18:32:08 2011 From: piotr.sikora at frickle.com (Piotr Sikora) Date: Tue, 10 May 2011 16:32:08 +0200 Subject: proxy_next_upstream and POSTs In-Reply-To: References: Message-ID: Hi, > 2. Any good advice on how I should do it? I was thinking on adding the > validation somewhere in ngx_http_upstream_test_next (ngx_http_upstream.c), > something like: > if (r->method == NGX_HTTP_POST) { > return NGX_DECLINED; > } Keep in mind that you should decline sending request to another backend, only if you already sent it upstream. There is a bunch of errors (bad gateway, connection timeout, etc) which could lead to the code path in question, for which you should still send request to another backend. Best regards, Piotr Sikora < piotr.sikora at frickle.com > From ionathan at gmail.com Tue May 10 18:48:28 2011 From: ionathan at gmail.com (Jonathan Leibiusky) Date: Tue, 10 May 2011 11:48:28 -0300 Subject: proxy_next_upstream and POSTs In-Reply-To: References: Message-ID: Right, that is why after digging for a while I realized I wan't doing it the right way. Now I wrote a module that will hook into the upstream logic and will set all the callbacks to the round-robin callbacks. Only the the peer.free callback will call the original round-robin callback and after that will do something like: if (r->method == NGX_HTTP_POST) { pc->retries = 0; } by setting retires = 0 I think nginx won't retry and will fail and I will be using round-robin logic for all the rest. My only problem is that in the peer.free callback I don't have access to the request struct, so I don't know is the request's method. So now I am not sure if the approach is the right one. Any thoughts on this? On Tue, May 10, 2011 at 11:32 AM, Piotr Sikora wrote: > Hi, > > > 2. Any good advice on how I should do it? I was thinking on adding the >> validation somewhere in ngx_http_upstream_test_next (ngx_http_upstream.c), >> something like: >> if (r->method == NGX_HTTP_POST) { >> return NGX_DECLINED; >> } >> > > Keep in mind that you should decline sending request to another backend, > only if you already sent it upstream. There is a bunch of errors (bad > gateway, connection timeout, etc) which could lead to the code path in > question, for which you should still send request to another backend. > > Best regards, > Piotr Sikora < piotr.sikora at frickle.com > > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ionathan at gmail.com Tue May 10 23:30:30 2011 From: ionathan at gmail.com (Jonathan Leibiusky) Date: Tue, 10 May 2011 16:30:30 -0300 Subject: proxy_next_upstream and POSTs In-Reply-To: References: Message-ID: Ok. Finally I could work it out, so thanks anyway! Here is my small contribution to nginx, it is not much, but it is something. https://github.com/xetorthio/nginx-upstream-idempotent Thanks everyone for your help, and if you have time and find something weired in the code, let me know! Jonathan On Tue, May 10, 2011 at 11:48 AM, Jonathan Leibiusky wrote: > Right, that is why after digging for a while I realized I wan't doing it > the right way. > Now I wrote a module that will hook into the upstream logic and will set > all the callbacks to the round-robin callbacks. Only the the peer.free > callback will call the original round-robin callback and after that will do > something like: > > > if (r->method == NGX_HTTP_POST) { > pc->retries = 0; > } > > by setting retires = 0 I think nginx won't retry and will fail and I will > be using round-robin logic for all the rest. > > My only problem is that in the peer.free callback I don't have access to > the request struct, so I don't know is the request's method. So now I am not > sure if the approach is the right one. > > Any thoughts on this? > > > On Tue, May 10, 2011 at 11:32 AM, Piotr Sikora wrote: > >> Hi, >> >> >> 2. Any good advice on how I should do it? I was thinking on adding the >>> validation somewhere in ngx_http_upstream_test_next (ngx_http_upstream.c), >>> something like: >>> if (r->method == NGX_HTTP_POST) { >>> return NGX_DECLINED; >>> } >>> >> >> Keep in mind that you should decline sending request to another backend, >> only if you already sent it upstream. There is a bunch of errors (bad >> gateway, connection timeout, etc) which could lead to the code path in >> question, for which you should still send request to another backend. >> >> Best regards, >> Piotr Sikora < piotr.sikora at frickle.com > >> >> >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://nginx.org/mailman/listinfo/nginx >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed May 11 01:59:41 2011 From: nginx-forum at nginx.us (jeanjan) Date: Tue, 10 May 2011 17:59:41 -0400 Subject: cgi files in plain text Message-ID: <875369c24424bd6f71a4658c85bce47b.NginxMailingListEnglish@forum.nginx.org> Hi, I installed nginx and php5-fpm from repositories on ubuntu 10.04. everything works well. The phpinfo test file works. I try to access collection (for collectd) pages. When I access the url of the collection3/bin/index.cgi, I can see the file in plain text. This is the config file used : server { listen 80; server_name toto.com; access_log /var/log/nginx/localhost.access.log; ## Default location location / { root /var/www; index index.php; try_files $uri $uri/ /index.php?q=$uri&$args; auth_basic "Restricted"; auth_basic_user_file /var/htpasswd_au1; } # Protection #location = /var/www { # auth_basic "Restricted"; # auth_basic_user_file /var/htpasswd_au1; #} ## try_files $uri $uri/ /index.php?q=$uri; ## Images and static content is treated different location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ { access_log off; expires 30d; root /var/www; } ## Parse all .php file in the /var/www directory location ~ .php$ { fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name; include fastcgi_params; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_intercept_errors on; fastcgi_ignore_client_abort off; fastcgi_connect_timeout 60; fastcgi_send_timeout 180; fastcgi_read_timeout 180; fastcgi_buffer_size 128k; fastcgi_buffers 4 256k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; } ## Disable viewing .htaccess & .htpassword location ~ /\.ht { deny all; } } upstream backend { server 127.0.0.1:9000; } Thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,197100,197100#msg-197100 From nginx-forum at nginx.us Wed May 11 03:07:36 2011 From: nginx-forum at nginx.us (brianmercer) Date: Tue, 10 May 2011 19:07:36 -0400 Subject: cgi files in plain text In-Reply-To: <875369c24424bd6f71a4658c85bce47b.NginxMailingListEnglish@forum.nginx.org> References: <875369c24424bd6f71a4658c85bce47b.NginxMailingListEnglish@forum.nginx.org> Message-ID: jeanjan Wrote: ------------------------------------------------------- > Hi, > > I installed nginx and php5-fpm from repositories > on ubuntu 10.04. > everything works well. The phpinfo test file > works. > > I try to access collection (for collectd) pages. > When I access the url of the > collection3/bin/index.cgi, I can see the file in > plain text. > > This is the config file used : > server { > listen 80; > server_name toto.com; > access_log > /var/log/nginx/localhost.access.log; > > ## Default location > location / { > root /var/www; > index index.php; > try_files $uri $uri/ /index.php?q=$uri&$args; > auth_basic "Restricted"; > auth_basic_user_file /var/htpasswd_au1; > > } > > # Protection > #location = /var/www { > # auth_basic "Restricted"; > # auth_basic_user_file /var/htpasswd_au1; > #} > > ## try_files $uri $uri/ /index.php?q=$uri; > ## Images and static content is treated different > location ~* > ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ { > access_log off; > expires 30d; > root /var/www; > } > > > > ## Parse all .php file in the /var/www directory > location ~ .php$ { > fastcgi_split_path_info ^(.+\.php)(.*)$; > fastcgi_pass 127.0.0.1:9000; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME > /var/www$fastcgi_script_name; > include fastcgi_params; > fastcgi_param QUERY_STRING > $query_string; > fastcgi_param REQUEST_METHOD > $request_method; > fastcgi_param CONTENT_TYPE > $content_type; > fastcgi_param CONTENT_LENGTH > $content_length; > fastcgi_intercept_errors on; > fastcgi_ignore_client_abort off; > fastcgi_connect_timeout 60; > fastcgi_send_timeout 180; > fastcgi_read_timeout 180; > fastcgi_buffer_size 128k; > fastcgi_buffers 4 256k; > fastcgi_busy_buffers_size 256k; > fastcgi_temp_file_write_size 256k; > } > > ## Disable viewing .htaccess & .htpassword > location ~ /\.ht { > deny all; > } > } > upstream backend { > server 127.0.0.1:9000; > } > > Thanks You can either use a php-based web interface for collectd like php-collection or Collectd Graph Panel or if you need the ability to serve .cgi and .pl files (like for awstats) you'll have to install another backend daemon. You can use a light web server or I'd recommend fcgiwrap. A couple ppas have Lucid backports of the Ubuntu fcgiwrap package, (e.g. https://launchpad.net/~wwu-numerik/+archive/lucid). Posted at Nginx Forum: http://forum.nginx.org/read.php?2,197100,197123#msg-197123 From antoine.bonavita at gmail.com Wed May 11 12:03:10 2011 From: antoine.bonavita at gmail.com (Antoine Bonavita) Date: Wed, 11 May 2011 10:03:10 +0200 Subject: proxy_next_upstream and POSTs In-Reply-To: References: Message-ID: Glad to hear you made it. As far as testing goes, you might find interesting (or just fun) to read my own experiences with the subject: - http://www.nginx-discovery.com/2011/02/day-29-nginx-development-tool-chain.html - http://www.nginx-discovery.com/2011/03/day-32-moving-to-testnginx.html - http://www.nginx-discovery.com/2011/03/day-33-testnginx-pipelinedrequests.html - http://www.nginx-discovery.com/2011/03/day-40-testnginx-new-features.html As far as documentation of Test::Nginx goes, you might find the devel tree (https://github.com/agentzh/test-nginx/tree/devel) which includes my commits a bit more verbose than the "master" branch. Enjoy testing. A. -- Round-trip fares to nginx land as low as $0: visit http://www.nginx-discovery.com On Tue, May 10, 2011 at 9:30 PM, Jonathan Leibiusky wrote: > Ok. Finally I could work it out, so thanks anyway! > > Here is my small contribution to nginx, it is not much, but it is something. > > https://github.com/xetorthio/nginx-upstream-idempotent > > Thanks everyone for your help, and if you have time and find something > weired in the code, let me know! > > Jonathan > > On Tue, May 10, 2011 at 11:48 AM, Jonathan Leibiusky > wrote: >> >> Right, that is why after digging for a while I realized I wan't doing it >> the right way. >> Now I wrote a module that will hook into the upstream logic and will set >> all the callbacks to the round-robin callbacks. Only the the peer.free >> callback will call the original round-robin callback and after that will do >> something like: >> >> if (r->method == NGX_HTTP_POST) { >> ? pc->retries = 0; >> } >> >> by setting retires = 0 I think nginx won't retry and will fail and I will >> be using round-robin logic for all the rest. >> >> My only problem is that in the peer.free callback I don't have access to >> the request struct, so I don't know is the request's method. So now I am not >> sure if the approach is the right one. >> >> Any thoughts on this? >> >> On Tue, May 10, 2011 at 11:32 AM, Piotr Sikora >> wrote: >>> >>> Hi, >>> >>>> 2. Any good advice on how I should do it? I was thinking on adding the >>>> validation somewhere in ngx_http_upstream_test_next (ngx_http_upstream.c), >>>> something like: >>>> if (r->method == NGX_HTTP_POST) { >>>> ?return NGX_DECLINED; >>>> } >>> >>> Keep in mind that you should decline sending request to another backend, >>> only if you already sent it upstream. There is a bunch of errors (bad >>> gateway, connection timeout, etc) which could lead to the code path in >>> question, for which you should still send request to another backend. >>> >>> Best regards, >>> Piotr Sikora < piotr.sikora at frickle.com > >>> >>> >>> _______________________________________________ >>> nginx mailing list >>> nginx at nginx.org >>> http://nginx.org/mailman/listinfo/nginx >> > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > > From igor at sysoev.ru Wed May 11 14:06:16 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 11 May 2011 14:06:16 +0400 Subject: server_name for https In-Reply-To: <20110509090627.68905d0d@cholatse.wrk.lsn.camptocamp.com> References: <20110509090627.68905d0d@cholatse.wrk.lsn.camptocamp.com> Message-ID: <20110511100615.GB45105@sysoev.ru> On Mon, May 09, 2011 at 09:06:27AM +0200, Cedric Jeanneret wrote: > On Mon, 9 May 2011 14:18:09 +0800 > Jeff Pang wrote: > > > Hello, > > > > Since HTTPS doesn't support vhost, shall we have the need to put the > > server_name command in the server section? for example, > > > > server { > > listen 443; > > server_name xxx.example.com; > > .... > > } > > > > Thanks. > > > > > > o_O since when does HTTPS not support vhosts ? > > the only problem is when having multiple SSL vhosts on the same IP - the certificate has to cover all those vhosts. > > To answer your question, you shall provide: > server_name $_; > > it's the default vhost This is not default virtual host. Please read this: http://nginx.org/en/docs/http/server_names.html#miscellaneous_names -- Igor Sysoev From igor at sysoev.ru Wed May 11 14:07:20 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 11 May 2011 14:07:20 +0400 Subject: server_name for https In-Reply-To: References: Message-ID: <20110511100720.GC45105@sysoev.ru> On Mon, May 09, 2011 at 02:18:09PM +0800, Jeff Pang wrote: > Hello, > > Since HTTPS doesn't support vhost, shall we have the need to put the > server_name command in the server section? for example, > > server { > listen 443; > server_name xxx.example.com; > .... > } > > Thanks. server should always have a name. Or it will be "" by default. -- Igor Sysoev From cjeanneret at internux.ch Wed May 11 14:13:23 2011 From: cjeanneret at internux.ch (Cedric Jeanneret) Date: Wed, 11 May 2011 12:13:23 +0200 Subject: server_name for https In-Reply-To: <20110511100615.GB45105@sysoev.ru> References: <20110509090627.68905d0d@cholatse.wrk.lsn.camptocamp.com> <20110511100615.GB45105@sysoev.ru> Message-ID: <20110511121323.60180dc7@cholatse.wrk.lsn.camptocamp.com> On Wed, 11 May 2011 14:06:16 +0400 Igor Sysoev wrote: > On Mon, May 09, 2011 at 09:06:27AM +0200, Cedric Jeanneret wrote: > > On Mon, 9 May 2011 14:18:09 +0800 > > Jeff Pang wrote: > > > > > Hello, > > > > > > Since HTTPS doesn't support vhost, shall we have the need to put the > > > server_name command in the server section? for example, > > > > > > server { > > > listen 443; > > > server_name xxx.example.com; > > > .... > > > } > > > > > > Thanks. > > > > > > > > > > o_O since when does HTTPS not support vhosts ? > > > > the only problem is when having multiple SSL vhosts on the same IP - the certificate has to cover all those vhosts. > > > > To answer your question, you shall provide: > > server_name $_; > > > > it's the default vhost > > This is not default virtual host. Please read this: > http://nginx.org/en/docs/http/server_names.html#miscellaneous_names > > Woops, indeed - sorry :/ (never used this syntax in my installation... ) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From nginx-forum at nginx.us Wed May 11 14:27:38 2011 From: nginx-forum at nginx.us (zls) Date: Wed, 11 May 2011 06:27:38 -0400 Subject: nginx-1.0.2 In-Reply-To: <20110510122951.GE90700@sysoev.ru> References: <20110510122951.GE90700@sysoev.ru> Message-ID: <25b6ac0454130aaa48b9dbc133ad36a2.NginxMailingListEnglish@forum.nginx.org> feature not enabled on redhat by default because of no -pthread on testing? checking for POSIX semaphores /tmp/cc2q2SHU.o: In function `main': /search/zls/nginx/server_traffic/nginx-1.0.2.zls/objs/autotest.c:8: undefined reference to `sem_init' /search/zls/nginx/server_traffic/nginx-1.0.2.zls/objs/autotest.c:9: undefined reference to `sem_destroy' collect2: ld return 1 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,196951,197225#msg-197225 From igor at sysoev.ru Wed May 11 14:30:48 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 11 May 2011 14:30:48 +0400 Subject: nginx-1.0.2 In-Reply-To: <25b6ac0454130aaa48b9dbc133ad36a2.NginxMailingListEnglish@forum.nginx.org> References: <20110510122951.GE90700@sysoev.ru> <25b6ac0454130aaa48b9dbc133ad36a2.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110511103048.GG45105@sysoev.ru> On Wed, May 11, 2011 at 06:27:38AM -0400, zls wrote: > feature not enabled on redhat by default because of no -pthread on > testing? Yes, POSIX semaphores on Linux requires linking with libpthread. > checking for POSIX semaphores > > /tmp/cc2q2SHU.o: In function `main': > /search/zls/nginx/server_traffic/nginx-1.0.2.zls/objs/autotest.c:8: > undefined reference to `sem_init' > /search/zls/nginx/server_traffic/nginx-1.0.2.zls/objs/autotest.c:9: > undefined reference to `sem_destroy' > collect2: ld return 1 -- Igor Sysoev From nginx-forum at nginx.us Wed May 11 16:23:53 2011 From: nginx-forum at nginx.us (tuffclassified) Date: Wed, 11 May 2011 08:23:53 -0400 Subject: redirecting url from old to new Message-ID: Any body will help me to redirect my old wordpress post http://tuffclassified.com/xyz/ to new custom post http://tuffclassified.com/ads/xyz/ . It was easy in apache as i have to add just # END WordPress RewriteRule ^/(.*)$ http://tuffclassified.com/ads/$1 [R=301,L] Posted at Nginx Forum: http://forum.nginx.org/read.php?2,197247,197247#msg-197247 From edhoprima at gmail.com Wed May 11 16:30:43 2011 From: edhoprima at gmail.com (Edho P Arief) Date: Wed, 11 May 2011 19:30:43 +0700 Subject: redirecting url from old to new In-Reply-To: References: Message-ID: On Wed, May 11, 2011 at 7:23 PM, tuffclassified wrote: > Any body will help me to redirect my old ?wordpress post > http://tuffclassified.com/xyz/ to new custom post > http://tuffclassified.com/ads/xyz/ ?. It was easy in apache as i have to > add just > > # END WordPress > RewriteRule ^/(.*)$ http://tuffclassified.com/ads/$1 [R=301,L] > location /xyz/ { rewrite ^ /ads/$uri permanent; ... } From mp3geek at gmail.com Thu May 12 06:13:03 2011 From: mp3geek at gmail.com (Ryan B) Date: Thu, 12 May 2011 14:13:03 +1200 Subject: rewrite n00b Message-ID: Hi, Just wanting to enabled a rewrite of the following url, Redirecting all requests from http://www.domain.com/site/forums and http://www.domain.com/forums to http://forums.domain.com Thanks :) From igor at sysoev.ru Thu May 12 09:20:53 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 12 May 2011 09:20:53 +0400 Subject: rewrite n00b In-Reply-To: References: Message-ID: <20110512052052.GC99505@sysoev.ru> On Thu, May 12, 2011 at 02:13:03PM +1200, Ryan B wrote: > Hi, > Just wanting to enabled a rewrite of the following url, > > Redirecting all requests from http://www.domain.com/site/forums and > http://www.domain.com/forums to http://forums.domain.com server { server_name www.domain.com; location /forums { rewrite ^/forums(.*)$ http://forums.domain.com$1; } location /site/forums { rewrite ^/site/forums(.*)$ http://forums.domain.com$1; } ... -- Igor Sysoev From agentzh at gmail.com Thu May 12 14:30:52 2011 From: agentzh at gmail.com (agentzh) Date: Thu, 12 May 2011 18:30:52 +0800 Subject: proxy_next_upstream and POSTs In-Reply-To: References: Message-ID: On Wed, May 11, 2011 at 4:03 PM, Antoine Bonavita wrote: > As far as documentation of Test::Nginx goes, you might find the devel > tree (https://github.com/agentzh/test-nginx/tree/devel) which includes > my commits a bit more verbose than the "master" branch. > I've just merged test-nginx's devel branch back to its master after massive regression testing on my side. And I'll do a new CPAN release of Test::Nginx tomorrow or so :) Happy hacking! -agentzh From agentzh at gmail.com Thu May 12 14:35:28 2011 From: agentzh at gmail.com (agentzh) Date: Thu, 12 May 2011 18:35:28 +0800 Subject: proxy_next_upstream and POSTs In-Reply-To: References: Message-ID: On Wed, May 11, 2011 at 4:03 PM, Antoine Bonavita wrote: > As far as documentation of Test::Nginx goes, you might find the devel > tree (https://github.com/agentzh/test-nginx/tree/devel) which includes > my commits a bit more verbose than the "master" branch. > I've just merged test-nginx's devel branch back to its master after massive regression testing on my side. And I'll do a new CPAN release of Test::Nginx tomorrow or so :) Happy hacking! -agentzh From ash2kk at gmail.com Thu May 12 15:34:09 2011 From: ash2kk at gmail.com (Mikhail Mazursky) Date: Thu, 12 May 2011 17:34:09 +0600 Subject: redirecting url from old to new In-Reply-To: References: Message-ID: 2011/5/11 tuffclassified : > Any body will help me to redirect my old ?wordpress post > http://tuffclassified.com/xyz/ to new custom post > http://tuffclassified.com/ads/xyz/ ?. It was easy in apache as i have to > add just > > # END WordPress > RewriteRule ^/(.*)$ http://tuffclassified.com/ads/$1 [R=301,L] location / { rewrite ^ /ads$uri permanent; } From nginx-forum at nginx.us Thu May 12 15:58:20 2011 From: nginx-forum at nginx.us (tuffclassified) Date: Thu, 12 May 2011 07:58:20 -0400 Subject: redirecting url from old to new In-Reply-To: References: Message-ID: thanks later one seems to work Posted at Nginx Forum: http://forum.nginx.org/read.php?2,197247,197578#msg-197578 From kworthington at gmail.com Thu May 12 18:06:04 2011 From: kworthington at gmail.com (Kevin Worthington) Date: Thu, 12 May 2011 10:06:04 -0400 Subject: Nginx-1.0.2 for Windows 32-bit and 64-bit now available Message-ID: For those interested, Cygwin based versions of Nginx 1.0.2 for Windows (both 32-bit and 64-bit) builds are available here: http://www.kevinworthington.com/nginx-for-windows/ Blog post/announcement: http://www.kevinworthington.com/nginx-for-windows-1-0-2/ Cygwin is NOT required on your system to run this version; all needed files are included. Please note that I have been providing Cygwin based builds since before official Windows builds were made available. It's mostly to support folks already using the builds. Thank you, Kevin -- Kevin Worthington http://www.kevinworthington.com/ From nginx-forum at nginx.us Thu May 12 22:25:25 2011 From: nginx-forum at nginx.us (rubix81) Date: Thu, 12 May 2011 14:25:25 -0400 Subject: Locate Command Linux Problems Message-ID: Hey so I am trying to write installation software. I am installing third party software on a computer, but first I check to see if it has already been installed. I am trying to use the locate command but it is not returning anything. To test it, I put a file that I installed and copied it into a different directory. I know it is there, and I copy and pasted the title so that I knew that would be correct. "$locate filename.a" returns nothing, however. I can be sitting in the correct directory staring straight at the file and it will still not give me its location. Does anyone know more about how locate works who can help me figure this out? Thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,197663,197663#msg-197663 From dan.trainor at gmail.com Thu May 12 22:30:58 2011 From: dan.trainor at gmail.com (Dan Trainor) Date: Thu, 12 May 2011 11:30:58 -0700 Subject: Locate Command Linux Problems In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 11:25 AM, rubix81 wrote: > Hey so I am trying to write installation software. I am installing third > party software on a computer, but first I check to see if it has already > been installed. I am trying to use the locate command but it is not > returning anything. To test it, I put a file that I installed and copied > it into a different directory. I know it is there, and I copy and pasted > the title so that I knew that would be correct. "$locate filename.a" > returns nothing, however. I can be sitting in the correct directory > staring straight at the file and it will still not give me its location. > Does anyone know more about how locate works who can help me figure this > out? > > Thanks! Hi - mlocate, slocate rely on the command 'updatedb' which builds a database of files that exist. I don't think this is the proper way of checking, though.... doesn't the distribution support some sort of package accounting, such as RPM or deb or something like that? Other commands which you might find useful are 'which', which will travers the path and tell you if an executable exists. 'whereis' which does something similar, or you could simply: find / -name nginx -perm -o+rx All of these solutions are pretty dirty. If I were you I would try to ensure that first you're using a sane distribution, and second you trust whoever maintains that installation to not ever, ever install from a tarball, but to always use the distribution's package managemnet system. Thanks -dant From nginx-forum at nginx.us Fri May 13 03:59:15 2011 From: nginx-forum at nginx.us (the_traveller) Date: Thu, 12 May 2011 19:59:15 -0400 Subject: Rewrite rule for nginx from Apache In-Reply-To: <72a81ff3e80ed0b4b78cb81a348826cf@ruby-forum.com> References: <72a81ff3e80ed0b4b78cb81a348826cf@ruby-forum.com> Message-ID: <2507a2f6fd2c5e8a743f33ca869dfa82.NginxMailingListEnglish@forum.nginx.org> Please can you help me to convert this to nginx RewriteEngine on # If you are having problems or are using VirtualDocumentRoot, uncomment this line and set it to your directory. # RewriteBase /maindir/ RewriteOptions MaxRedirects=30 RewriteCond %{ENV:REDIRECT_STATUS} 200 RewriteRule .* - [L] RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^index(.*)$ index.php [QSA] RewriteRule ^chat/.* pages.php [QSA] RewriteRule ^Songs(.*)$ showcat.php?g=2 [QSA] RewriteRule ^Jokes(.*)$ showcat.php?g=3 [QSA] RewriteRule ^Ash3ar(.*)$ showcat.php?g=4 [QSA] RewriteRule ^iraq/.* showcat.php [QSA] RewriteRule ^Song/.* sounds.php [QSA] RewriteRule ^Joke/.* jokes.php [QSA] RewriteRule ^Poem/.* poems.php [QSA] RewriteRule ^link/.* advs.php [QSA] RewriteRule ^search/.* search.php [QSA] RewriteRule ^adv-conditions(.*)$ ad.php?go=conditions [NC] RewriteRule ^adv-payments(.*)$ ad.php?go=payments [NC] RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA] SecFilterEngine Off SecFilterScanPOST Off mod_gzip_on No Posted at Nginx Forum: http://forum.nginx.org/read.php?2,23868,197702#msg-197702 From omega13a at fedtrek.com Fri May 13 04:19:28 2011 From: omega13a at fedtrek.com (Brandon Amaro) Date: Thu, 12 May 2011 17:19:28 -0700 Subject: Rewrite rule for nginx from Apache In-Reply-To: <2507a2f6fd2c5e8a743f33ca869dfa82.NginxMailingListEnglish@forum.nginx.org> References: <72a81ff3e80ed0b4b78cb81a348826cf@ruby-forum.com> <2507a2f6fd2c5e8a743f33ca869dfa82.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4DCC7910.8000800@fedtrek.com> using http://www.anilcetin.com/convert-apache-htaccess-to-nginx/ , I got this: #ignored: condition 0 #ignored: "-" thing used or unknown variable in regex/rew if (-e $request_filename){ set $rule_1 1; } if ($request_filename ~ "-l"){ set $rule_1 1; } if (-d $request_filename){ set $rule_1 1; } if ($rule_1 = "1"){ #ignored: "-" thing used or unknown variable in regex/rew } rewrite ^/index(.*)$ /; rewrite ^/chat/.* /; rewrite ^/Songs(.*)$ /; rewrite ^/Jokes(.*)$ /; rewrite ^/Ash3ar(.*)$ /; rewrite ^/iraq/.* /; rewrite ^/Song/.* /; rewrite ^/Joke/.* /; rewrite ^/Poem/.* /; rewrite ^/link/.* /; rewrite ^/search/.* /; rewrite ^/adv-conditions(.*)$ /; rewrite ^/adv-payments(.*)$ /; if (-e $request_filename){ set $rule_15 1; } if ($request_filename ~ "-l"){ set $rule_15 1; } if (-d $request_filename){ set $rule_15 1; } if ($rule_15 = "1"){ #ignored: "-" thing used or unknown variable in regex/rew } rewrite ^/(?:(.*?)(?:/|$))(.*|$)$ /$1.php?r=$2; -- omega13a Owner and Founder of UFT http://www.fedtrek.com On 05/12/2011 04:59 PM, the_traveller wrote: > > RewriteEngine on > > # If you are having problems or are using VirtualDocumentRoot, uncomment > this line and set it to your directory. > # RewriteBase/maindir/ > RewriteOptions MaxRedirects=30 > RewriteCond %{ENV:REDIRECT_STATUS} 200 > RewriteRule .* - [L] > > > RewriteCond %{REQUEST_FILENAME} -s [OR] > RewriteCond %{REQUEST_FILENAME} -l [OR] > RewriteCond %{REQUEST_FILENAME} -d > > RewriteRule ^.*$ - [NC,L] > > RewriteRule ^index(.*)$ index.php > [QSA] > RewriteRule ^chat/.* pages.php > [QSA] > RewriteRule ^Songs(.*)$ > showcat.php?g=2 [QSA] > RewriteRule ^Jokes(.*)$ > showcat.php?g=3 [QSA] > RewriteRule ^Ash3ar(.*)$ > showcat.php?g=4 [QSA] > RewriteRule ^iraq/.* showcat.php > [QSA] > RewriteRule ^Song/.* sounds.php > [QSA] > RewriteRule ^Joke/.* jokes.php > [QSA] > RewriteRule ^Poem/.* poems.php > [QSA] > RewriteRule ^link/.* advs.php > [QSA] > RewriteRule ^search/.* search.php > [QSA] > RewriteRule ^adv-conditions(.*)$ > ad.php?go=conditions [NC] > RewriteRule ^adv-payments(.*)$ > ad.php?go=payments [NC] > > RewriteCond %{REQUEST_FILENAME} -s [OR] > RewriteCond %{REQUEST_FILENAME} -l [OR] > RewriteCond %{REQUEST_FILENAME} -d > > RewriteRule ^.*$ - [NC,L] > RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA] > > > > > > > SecFilterEngine Off > SecFilterScanPOST Off > > > > mod_gzip_on No > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri May 13 05:08:36 2011 From: nginx-forum at nginx.us (the_traveller) Date: Thu, 12 May 2011 21:08:36 -0400 Subject: Rewrite rule for nginx from Apache In-Reply-To: <2507a2f6fd2c5e8a743f33ca869dfa82.NginxMailingListEnglish@forum.nginx.org> References: <72a81ff3e80ed0b4b78cb81a348826cf@ruby-forum.com> <2507a2f6fd2c5e8a743f33ca869dfa82.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20303b9b6853ad3803b0460878e26cce.NginxMailingListEnglish@forum.nginx.org> well first of all thank you for you quick reply .. but i've tried this tool and it's not working... i there any way to know the basics of the ngnix??? other wise look at the rewrite model rewrite ^/index(.*)$ /; rewrite ^/chat/.* /; rewrite ^/Songs(.*)$ /; rewrite ^/Jokes(.*)$ /; rewrite ^/Ash3ar(.*)$ /; rewrite ^/iraq/.* /; rewrite ^/Song/.* /; rewrite ^/Joke/.* /; rewrite ^/Poem/.* /; rewrite ^/link/.* /; rewrite ^/search/.* /; rewrite ^/adv-conditions(.*)$ /; rewrite ^/adv-payments(.*)$ /; it haven't consider the file file names ... so i'm little bit confused about that tool and so it didn't work Posted at Nginx Forum: http://forum.nginx.org/read.php?2,23868,197717#msg-197717 From bbskill at gmail.com Fri May 13 06:58:54 2011 From: bbskill at gmail.com (Liu bbskill) Date: Fri, 13 May 2011 10:58:54 +0800 Subject: Why doesn't Nginx support fastcgi keepalive connection? Message-ID: Hi, all It seems that nginx will communicate with fastcgi using short connection, and with heavy load, nginx and fastcgi will cause large number of TIME_WAIT. It's annoying. I am wondering why nginx doesn't support fastcgi keepalive connection(* FCGI_KEEP_CONN*)? Are there some special considerations? -- JinBiao Liu -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri May 13 08:49:53 2011 From: nginx-forum at nginx.us (spacereactor) Date: Fri, 13 May 2011 00:49:53 -0400 Subject: After upgrading nginx from 0.8.54 to 1.0.2, getting blank page with drupal context module install Message-ID: This is the error log from server 2011/05/11 17:40:02 [error] 3358#0: *1 FastCGI sent in stderr: "PHP Fatal error: require() [function.require]: Failed opening required 'context.core.inc' (include_path='.:/usr/local/lib/php') in ??? on line 3" while reading response header from upstream, client: 220.255.1.81, server: mydomain.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "mydomain.com" 2011/05/11 17:40:05 [error] 3358#0: *1 FastCGI sent in stderr: "PHP Fatal error: require() [function.require]: Failed opening required 'context.core.inc' (include_path='.:/usr/local/lib/php') in x ? on line 3" while reading response header from upstream, client: 220.255.1.81, server: mydomain.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "mydomain.com" 2011/05/11 17:45:08 [error] 3383#0: *1 no user/password was provided for basic authentication, client: 220.255.1.85, server: mydomain.com, request: "GET /install.php HTTP/1.1", host: "mydomain.com" 2011/05/11 17:50:22 [error] 3383#0: *115 FastCGI sent in stderr: "PHP Fatal error: require() [function.require]: Failed opening required 'context.core.inc' (include_path='.:/usr/local/lib/php') in ??? on line 3" while reading response header from upstream, client: 220.255.1.52, server: mydomain.com, request: "POST /admin/build/modules/list/confirm HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "mydomain.com", referrer: "http://mydomain.com/admin/build/modules/list/confirm" My using linode server, nginx 1.0.2 / php 5.2.17 / php-fpm / mariadb 5.2 If i purge nginx 1.0.2 and install back 0.8.54 the drupal context work. I also try with a fresh install of drupal and only install context modules and i getting error with nginx 1.0.2 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,197733,197733#msg-197733 From appa at perusio.net Fri May 13 09:20:41 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Fri, 13 May 2011 06:20:41 +0100 Subject: After upgrading nginx from 0.8.54 to 1.0.2, getting blank page with drupal context module install In-Reply-To: References: Message-ID: <87tycz9nx2.wl%appa@perusio.net> On 13 Mai 2011 05h49 WEST, nginx-forum at nginx.us wrote: That seems to be a PHP problem. Try to restart fpm and see if the problem remains. Are you using APC? > This is the error log from server 2011/05/11 17:40:02 [error] > 3358#0: *1 FastCGI sent in stderr: "PHP Fatal error: require() [ href='function.require'>function.require]: Failed opening > required 'context.core.inc' (include_path='.:/usr/local/lib/php') in > ??? on line 3" while reading response header from upstream, > client: 220.255.1.81, server: mydomain.com, request: "GET / > HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: > "mydomain.com" 2011/05/11 17:40:05 [error] 3358#0: *1 FastCGI sent > in stderr: "PHP Fatal error: require() [ href='function.require'>function.require]: Failed opening > required 'context.core.inc' (include_path='.:/usr/local/lib/php') in > x ? on line 3" while reading response header from upstream, > client: 220.255.1.81, server: mydomain.com, request: "GET / > HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: > "mydomain.com" 2011/05/11 17:45:08 [error] 3383#0: *1 no > user/password was provided for basic authentication, client: > 220.255.1.85, server: mydomain.com, request: "GET /install.php > HTTP/1.1", host: "mydomain.com" 2011/05/11 17:50:22 [error] 3383#0: > *115 FastCGI sent in stderr: "PHP Fatal error: require() [ href='function.require'>function.require]: Failed opening > required 'context.core.inc' (include_path='.:/usr/local/lib/php') in > ??? on line 3" while reading response header from upstream, > client: 220.255.1.52, server: mydomain.com, request: "POST > /admin/build/modules/list/confirm HTTP/1.1", upstream: > "fastcgi://unix:/var/run/php5-fpm.sock:", host: "mydomain.com", > referrer: "http://mydomain.com/admin/build/modules/list/confirm" --- appa From nginx-forum at nginx.us Fri May 13 09:28:25 2011 From: nginx-forum at nginx.us (spacereactor) Date: Fri, 13 May 2011 01:28:25 -0400 Subject: After upgrading nginx from 0.8.54 to 1.0.2, getting blank page with drupal context module install In-Reply-To: References: Message-ID: <4ef952b878dd0ca524e672548548de08.NginxMailingListEnglish@forum.nginx.org> try restart php-fpm and also test with APC-3.1.7 but result is the same error, i even try update the APC to APC-3.18 but also the same problem. If it the context module php issue, than should nginx 0.8.54 also have that problem but drupal context work under nginx 0.8.54 but not nginx 1.0.2 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,197733,197740#msg-197740 From appa at perusio.net Fri May 13 16:21:15 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Fri, 13 May 2011 13:21:15 +0100 Subject: After upgrading nginx from 0.8.54 to 1.0.2, getting blank page with drupal context module install In-Reply-To: <4ef952b878dd0ca524e672548548de08.NginxMailingListEnglish@forum.nginx.org> References: <4ef952b878dd0ca524e672548548de08.NginxMailingListEnglish@forum.nginx.org> Message-ID: <87sjsiaj0k.wl%appa@perusio.net> On 13 Mai 2011 06h28 WEST, nginx-forum at nginx.us wrote: > try restart php-fpm and also test with APC-3.1.7 but result is the > same error, i even try update the APC to APC-3.18 but also the same > problem. If it the context module php issue, than should nginx > 0.8.54 also have that problem but drupal context work under nginx > 0.8.54 but not nginx 1.0.2 I propose we move this conversation to the g.d.o nginx group http://groups.drupal.org/nginx Context works ok for me with 1.0.2. --- appa From lists at ruby-forum.com Fri May 13 17:02:28 2011 From: lists at ruby-forum.com (John Travolota) Date: Fri, 13 May 2011 15:02:28 +0200 Subject: kernel: nginx[18233]: segfault at 0000000000000008 rip 000000000043edf8 rsp 00007fff34a21fa0 error 4 Message-ID: I having this message which i posted in subject repeating a lot in /var/log/messages,is this some kind of bug?Nginx ver 1.0.1 -- Posted via http://www.ruby-forum.com/. From mdounin at mdounin.ru Fri May 13 17:09:31 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 13 May 2011 17:09:31 +0400 Subject: Why doesn't Nginx support fastcgi keepalive connection? In-Reply-To: References: Message-ID: <20110513130931.GW42265@mdounin.ru> Hello! On Fri, May 13, 2011 at 10:58:54AM +0800, Liu bbskill wrote: > Hi, all > > It seems that nginx will communicate with fastcgi using short > connection, and with heavy load, nginx and fastcgi will cause large number > of TIME_WAIT. It's annoying. > > I am wondering why nginx doesn't support fastcgi keepalive connection(* > FCGI_KEEP_CONN*)? > > Are there some special considerations? There are some experimental patches available which add fastcgi keepalive support (with upstream keepalive module). I'll post refreshed version in a few weeks. Maxim Dounin From mdounin at mdounin.ru Fri May 13 17:18:56 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 13 May 2011 17:18:56 +0400 Subject: kernel: nginx[18233]: segfault at 0000000000000008 rip 000000000043edf8 rsp 00007fff34a21fa0 error 4 In-Reply-To: References: Message-ID: <20110513131856.GX42265@mdounin.ru> Hello! On Fri, May 13, 2011 at 03:02:28PM +0200, John Travolota wrote: > I having this message which i posted in subject repeating a lot in > /var/log/messages,is this some kind of bug?Nginx ver 1.0.1 Segmentation fault is always some kind of bug (though not always in the programm which actually segfaults). Please provide at least nginx -V output, config and backtrace. See here for more details: http://wiki.nginx.org/Debugging Maxim Dounin From lists at ruby-forum.com Fri May 13 17:23:04 2011 From: lists at ruby-forum.com (John Travolota) Date: Fri, 13 May 2011 15:23:04 +0200 Subject: kernel: nginx[18233]: segfault at 0000000000000008 rip 000000000043edf8 rsp 00007fff34a21fa0 err In-Reply-To: References: Message-ID: Here is output of V along with full conf options,not sure how to do backtrace. nginx: nginx version: nginx/1.0.1 nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-48) nginx: TLS SNI support disabled nginx: configure arguments: --sbin-path=/usr/local/sbin --with-http_ssl_module --with-http_geoip_module --without-http_autoindex_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_stub_st atus_module -- Posted via http://www.ruby-forum.com/. From b.yordanov at exsisto.com Fri May 13 17:31:06 2011 From: b.yordanov at exsisto.com (Boyko Yordanov) Date: Fri, 13 May 2011 16:31:06 +0300 Subject: kernel: nginx[18233]: segfault at 0000000000000008 rip 000000000043edf8 rsp 00007fff34a21fa0 err In-Reply-To: References: Message-ID: <86C89487-2A95-4CEE-86D2-CC6994880AA6@exsisto.com> He gave you a hint: http://wiki.nginx.org/Debugging On May 13, 2011, at 4:23 PM, John Travolota wrote: > not sure how to do > backtrace. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mp3geek at gmail.com Fri May 13 19:02:52 2011 From: mp3geek at gmail.com (Ryan B) Date: Sat, 14 May 2011 03:02:52 +1200 Subject: rewrite n00b In-Reply-To: <20110512052052.GC99505@sysoev.ru> References: <20110512052052.GC99505@sysoev.ru> Message-ID: Awesome thanks :) I've got this, to redirect the requests, but If I request a file from the orginal host, it won't redirect to the same file on the ip. rewrite ^ http://113.214.191.192 permanent; So http://domain.com/files.txt -> redirects to http://113.214.191.192/files.txt (without the need to specifiy each file name) Thanks for the help On Thu, May 12, 2011 at 5:20 PM, Igor Sysoev wrote: > On Thu, May 12, 2011 at 02:13:03PM +1200, Ryan B wrote: >> Hi, >> Just wanting to enabled a rewrite of the following url, >> >> Redirecting all requests from http://www.domain.com/site/forums and >> http://www.domain.com/forums to http://forums.domain.com > > server { > ? ?server_name ?www.domain.com; > > ? ?location /forums { > ? ? ? ?rewrite ?^/forums(.*)$ ?http://forums.domain.com$1; > ? ?} > > ? ?location /site/forums { > ? ? ? ?rewrite ?^/site/forums(.*)$ ?http://forums.domain.com$1; > ? ?} > > ? ?... > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > From igor at sysoev.ru Fri May 13 22:16:51 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 13 May 2011 22:16:51 +0400 Subject: rewrite n00b In-Reply-To: References: <20110512052052.GC99505@sysoev.ru> Message-ID: <20110513181651.GC91483@sysoev.ru> On Sat, May 14, 2011 at 03:02:52AM +1200, Ryan B wrote: > Awesome thanks :) > > I've got this, to redirect the requests, but If I request a file from > the orginal host, it won't redirect to the same file on the ip. > > rewrite ^ http://113.214.191.192 permanent; > > So http://domain.com/files.txt -> redirects to > http://113.214.191.192/files.txt (without the need to specifiy each > file name) rewrite ^ http://113.214.191.192$request_uri? permanent; -- Igor Sysoev From nginx-forum at nginx.us Fri May 13 22:54:06 2011 From: nginx-forum at nginx.us (holstebm) Date: Fri, 13 May 2011 14:54:06 -0400 Subject: IPv6 Issues / Question Message-ID: <170e85c7ee18ce77bcc3ba9560b19f84.NginxMailingListEnglish@forum.nginx.org> Last night I had my provider (Linode) add IPv6 support for my server. I also had them assign me an IPv6 pool to use. I have Nginx 1.0.2 compiled with IPv6 support, restarted my Nginx and everything was fine all night and most of the morning. However, within minutes of me adding AAAA records to my domains, Nginx stopped and running and took the IPv4 networking down with it. I hadn't even restarted Nginx after adding the records. Upon reboot with Nginx disabled, everything runs fine. I start Nginx and make a single IPv4 page request, the network is completely gone again on all ports. I don't believe in coincidences so what could adding AAAA records to domains Nginx is listening for on port 80 trigger? Nginx had been running without problems for 12 hours with IPv6 enabled on the server with an assigned global scope IPv6 address. Within minutes of me adding those AAAA records, the trouble began. I don't see anything in the logs that helps. Here is my configuration for Nginx: nginx: configure arguments: --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --user=nginx --group=nginx --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --prefix=/usr/share/nginx --pid-path=/var/run/nginx.pid --add-module=../headers-more-nginx-module --add-module=../ngx_http_redis-0.3.1 --add-module=../ngx_http_upstream_keepalive --add-module=../memc-nginx-module --add-module=../ngx_cache_purge --add-module=/usr/local/rvm/gems/ruby-1.9.2-p0 at rails3/gems/passenger-3.0.2/ext/nginx --add-module=../ngx_http_log_request_speed --add-module=../mod_strip --with-ipv6 --with-http_ssl_module --with-http_gzip_static_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_realip_module --with-http_stub_status_module --with-http_flv_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --without-select_module --without-poll_module --with-openssl=../openssl-1.0.0d --with-pcre=../pcre-8.12 --with-zlib=../zlib-1.2.5 --with-cpu-opt=Xeon --with-cc-opt='-pipe -s -O3 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -mmmx -msse -msse2 -msse3 -mfpmath=sse -mtune=native -march=native -enable-new-dtags -DNODEBUG -DNDEBUG -enable-stdcall-fixup -frerun-loop-opt -ftracer' Posted at Nginx Forum: http://forum.nginx.org/read.php?2,197875,197875#msg-197875 From nginx-forum at nginx.us Fri May 13 23:05:22 2011 From: nginx-forum at nginx.us (holstebm) Date: Fri, 13 May 2011 15:05:22 -0400 Subject: IPv6 Issues / Question In-Reply-To: <170e85c7ee18ce77bcc3ba9560b19f84.NginxMailingListEnglish@forum.nginx.org> References: <170e85c7ee18ce77bcc3ba9560b19f84.NginxMailingListEnglish@forum.nginx.org> Message-ID: <775d45c0b90e18499e713b91724261d0.NginxMailingListEnglish@forum.nginx.org> I should add that disabling IPv6 this way: sysctl -w net.ipv6.conf.all.disable_ipv6=1 sysctl -w net.ipv6.conf.default.disable_ipv6=1 sysctl -w net.ipv6.conf.lo.disable_ipv6=1 without making any changes to the Nginx configuration, works. So it is definitely related to IPv6 and Nginx. TIA! Bret Posted at Nginx Forum: http://forum.nginx.org/read.php?2,197875,197877#msg-197877 From igor at sysoev.ru Fri May 13 23:13:45 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 13 May 2011 23:13:45 +0400 Subject: IPv6 Issues / Question In-Reply-To: <170e85c7ee18ce77bcc3ba9560b19f84.NginxMailingListEnglish@forum.nginx.org> References: <170e85c7ee18ce77bcc3ba9560b19f84.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110513191345.GF91483@sysoev.ru> On Fri, May 13, 2011 at 02:54:06PM -0400, holstebm wrote: > Last night I had my provider (Linode) add IPv6 support for my server. I > also had them assign me an IPv6 pool to use. > > I have Nginx 1.0.2 compiled with IPv6 support, restarted my Nginx and > everything was fine all night and most of the morning. However, within > minutes of me adding AAAA records to my domains, Nginx stopped and > running and took the IPv4 networking down with it. I hadn't even > restarted Nginx after adding the records. > > Upon reboot with Nginx disabled, everything runs fine. I start Nginx > and make a single IPv4 page request, the network is completely gone > again on all ports. What do you mean by "took the IPv4 networking down" ? Does it mean that any (inlcuding ssh, etc) IPv4 traffic goes down, or only HTTP or what ? -- Igor Sysoev From nginx-forum at nginx.us Fri May 13 23:25:47 2011 From: nginx-forum at nginx.us (holstebm) Date: Fri, 13 May 2011 15:25:47 -0400 Subject: IPv6 Issues / Question In-Reply-To: <20110513191345.GF91483@sysoev.ru> References: <20110513191345.GF91483@sysoev.ru> Message-ID: Literally everything. SSH - everything. This is a VPS (Linode) with a Lish AJAX console that normally works even when all other networking is disabled and even it was down. I was literally blind and the only option left was to reboot each time. It took several reboots to narrow it down to a particular service. Please let me know if there is a particular log I should look at. I've looked at the messages and syslog as well as the access and error logs for nginx and they are all missing entries during the time networking was down. Thanks! I've been using Nginx for years barely a hiccup until this. Bret Posted at Nginx Forum: http://forum.nginx.org/read.php?2,197875,197883#msg-197883 From nginx-forum at nginx.us Fri May 13 23:28:39 2011 From: nginx-forum at nginx.us (holstebm) Date: Fri, 13 May 2011 15:28:39 -0400 Subject: IPv6 Issues / Question In-Reply-To: References: <20110513191345.GF91483@sysoev.ru> Message-ID: <980b1fdb965f8d91fd342cdd1785f3fd.NginxMailingListEnglish@forum.nginx.org> I haven't eliminated the possibility that Nginx is the symptom and not the cause. Of course, under the circumstances, I'm not sure how I might do that. But I am willing to provide anything you need to help get to the bottom of this. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,197875,197885#msg-197885 From igor at sysoev.ru Fri May 13 23:36:57 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 13 May 2011 23:36:57 +0400 Subject: IPv6 Issues / Question In-Reply-To: References: <20110513191345.GF91483@sysoev.ru> Message-ID: <20110513193657.GG91483@sysoev.ru> On Fri, May 13, 2011 at 03:25:47PM -0400, holstebm wrote: > Literally everything. SSH - everything. This is a VPS (Linode) with a > Lish AJAX console that normally works even when all other networking is > disabled and even it was down. I was literally blind and the only > option left was to reboot each time. It took several reboots to narrow > it down to a particular service. I believe this is a bug in Linux or VPS. A user mode program even run with root privilege that makes only usual listen/bind/setsockopt/accept/etc syscalls on IPv6 sockets should not cause such issues. -- Igor Sysoev From nginx-forum at nginx.us Fri May 13 23:47:29 2011 From: nginx-forum at nginx.us (holstebm) Date: Fri, 13 May 2011 15:47:29 -0400 Subject: IPv6 Issues / Question In-Reply-To: <20110513193657.GG91483@sysoev.ru> References: <20110513193657.GG91483@sysoev.ru> Message-ID: <463cd14d8c152c338ea9fe5612f22c9d.NginxMailingListEnglish@forum.nginx.org> Okay, thanks, I'll into that bit more. This is a production machine which, right now, limits me a bit. I is running Ubuntu 10.04 with one of the kernels from Linode. Sometime overnight this weekend, I'll play with it a bit more. I can use other kernels or compile my own, if necessary. I was hoping what you thought about the AAAA records being added and the appearance of the issue might be helpful as it seems strange. Perhaps a routing problem of some sort when Nginx sent out a reply? Thanks for you help! Bret Posted at Nginx Forum: http://forum.nginx.org/read.php?2,197875,197892#msg-197892 From igor at sysoev.ru Fri May 13 23:49:42 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 13 May 2011 23:49:42 +0400 Subject: IPv6 Issues / Question In-Reply-To: <463cd14d8c152c338ea9fe5612f22c9d.NginxMailingListEnglish@forum.nginx.org> References: <20110513193657.GG91483@sysoev.ru> <463cd14d8c152c338ea9fe5612f22c9d.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110513194942.GH91483@sysoev.ru> On Fri, May 13, 2011 at 03:47:29PM -0400, holstebm wrote: > Okay, thanks, I'll into that bit more. This is a production machine > which, right now, limits me a bit. I is running Ubuntu 10.04 with one > of the kernels from Linode. Sometime overnight this weekend, I'll play > with it a bit more. I can use other kernels or compile my own, if > necessary. > > I was hoping what you thought about the AAAA records being added and the > appearance of the issue might be helpful as it seems strange. Perhaps a > routing problem of some sort when Nginx sent out a reply? AAAA record may just cause IPv6 traffic to the host. And the traffic may cause kernel issues. -- Igor Sysoev From nginx-forum at nginx.us Sat May 14 00:01:09 2011 From: nginx-forum at nginx.us (jfix) Date: Fri, 13 May 2011 16:01:09 -0400 Subject: trouble with forward proxying In-Reply-To: <4e5c2db6e47b5d013dfbb23fa21a4b8a.NginxMailingListEnglish@forum.nginx.org> References: <4e5c2db6e47b5d013dfbb23fa21a4b8a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <10bb050b819b0ef52aebb1a5f4b0890e.NginxMailingListEnglish@forum.nginx.org> thanks, I have switched to squid. Jakob. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,196115,197896#msg-197896 From jeffrpang at gmail.com Sat May 14 00:06:47 2011 From: jeffrpang at gmail.com (Jeff Pang) Date: Sat, 14 May 2011 04:06:47 +0800 Subject: trouble with forward proxying In-Reply-To: <10bb050b819b0ef52aebb1a5f4b0890e.NginxMailingListEnglish@forum.nginx.org> References: <4e5c2db6e47b5d013dfbb23fa21a4b8a.NginxMailingListEnglish@forum.nginx.org> <10bb050b819b0ef52aebb1a5f4b0890e.NginxMailingListEnglish@forum.nginx.org> Message-ID: 2011/5/14 jfix : > thanks, I have switched to squid. Jakob. > Squid is Proxy + Caching, it will improve the speed if you have lots of static files. But Squid is not compatible as well as Nginx for HTTP/1.1. -- Jeff Pang www.DNSbed.com From nginx-forum at nginx.us Sat May 14 00:09:09 2011 From: nginx-forum at nginx.us (jfix) Date: Fri, 13 May 2011 16:09:09 -0400 Subject: gzip compression not taken into account? Message-ID: Hi, I have enabled gzip compression following the wiki instructions like this: location / { #.... gzip on; gzip_min_length 1000; gzip_proxied expired no-cache no-store private auth; gzip_types text/plain application/xml text/javascript text/css application/x-javascript; gzip_disable "MSIE [1-6]\."; #... } unfortunately, both Yahoo's yslow and Google's pagespeed tell me that I should enable compression for better performance. How can I find out why compression doesn't seem to happen? I've selected the mime-types after having looked at them in chrome's web inspector. Thank you in advance, Jakob. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,197898,197898#msg-197898 From dan.trainor at gmail.com Sat May 14 00:19:55 2011 From: dan.trainor at gmail.com (Dan Trainor) Date: Fri, 13 May 2011 13:19:55 -0700 Subject: gzip compression not taken into account? In-Reply-To: References: Message-ID: Hi - Are those tools misreporting? What does the content-encoding: header say? On May 13, 2011 1:09 PM, "jfix" wrote: > Hi, I have enabled gzip compression following the wiki instructions like > this: > > location / { > #.... > > gzip on; > gzip_min_length 1000; > gzip_proxied expired no-cache no-store private auth; > gzip_types text/plain application/xml text/javascript text/css > application/x-javascript; > gzip_disable "MSIE [1-6]\."; > > #... > } > > unfortunately, both Yahoo's yslow and Google's pagespeed tell me that I > should enable compression for better performance. > > How can I find out why compression doesn't seem to happen? I've > selected the mime-types after having looked at them in chrome's web > inspector. > > Thank you in advance, > Jakob. > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,197898,197898#msg-197898 > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From jocelyn.mocquant at gmail.com Sat May 14 03:00:27 2011 From: jocelyn.mocquant at gmail.com (Jocelyn) Date: Fri, 13 May 2011 16:00:27 -0700 Subject: gzip compression not taken into account? In-Reply-To: References: Message-ID: Hi, Maybe you'are encountering what Steve Souders call the "Turtle Tapping". You need to check the Accept-Encoding HTTP header from the browser side (need to be: Accept-Encoding: gzip, deflate). In some cases (in order to analyse faster the content of the traffic), web-proxies and Antivirus are mangled the Accept-Encoding HTTP header. -- Regards Jocelyn Mocquant On Fri, May 13, 2011 at 1:19 PM, Dan Trainor wrote: > Hi - > > Are those tools misreporting? What does the content-encoding: header say? > On May 13, 2011 1:09 PM, "jfix" wrote: > > Hi, I have enabled gzip compression following the wiki instructions like > > this: > > > > location / { > > #.... > > > > gzip on; > > gzip_min_length 1000; > > gzip_proxied expired no-cache no-store private auth; > > gzip_types text/plain application/xml text/javascript text/css > > application/x-javascript; > > gzip_disable "MSIE [1-6]\."; > > > > #... > > } > > > > unfortunately, both Yahoo's yslow and Google's pagespeed tell me that I > > should enable compression for better performance. > > > > How can I find out why compression doesn't seem to happen? I've > > selected the mime-types after having looked at them in chrome's web > > inspector. > > > > Thank you in advance, > > Jakob. > > > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,197898,197898#msg-197898 > > > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sat May 14 03:24:12 2011 From: nginx-forum at nginx.us (Jocelyn Mocquant) Date: Fri, 13 May 2011 19:24:12 -0400 Subject: Keepalived Connections Reset after reloading the configuration (HUP Signal) Message-ID: <46781f68e473c0d6a12e4a3e9788a38e.NginxMailingListEnglish@forum.nginx.org> Hello, I'm dealing with a problem. When reloading the nginx configuration, all keepalived connections receive the TCP reset flag after I send a HUP signal to the master process. If I comment the line responsible for enabling the keepalive feature in the configuration, the problem disappear (nginx version is 0.9.7). Thanks in advance, Jocelyn Mocquant Posted at Nginx Forum: http://forum.nginx.org/read.php?2,197927,197927#msg-197927 From nginx-forum at nginx.us Sat May 14 13:28:19 2011 From: nginx-forum at nginx.us (spacereactor) Date: Sat, 14 May 2011 05:28:19 -0400 Subject: After upgrading nginx from 0.8.54 to 1.0.2, getting blank page with drupal context module install In-Reply-To: <87sjsiaj0k.wl%appa@perusio.net> References: <87sjsiaj0k.wl%appa@perusio.net> Message-ID: <6791015a56febd3a29bec29a25ea3fc0.NginxMailingListEnglish@forum.nginx.org> is indeed APC-3.18 that cause the problem, i re-compile the php and use APC-3.17 it work, and purge all and re-compile php and APC-3.18 and it doesn't work. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,197733,197970#msg-197970 From nginx-forum at nginx.us Sat May 14 16:19:45 2011 From: nginx-forum at nginx.us (jeanjan) Date: Sat, 14 May 2011 08:19:45 -0400 Subject: cgi files in plain text In-Reply-To: <875369c24424bd6f71a4658c85bce47b.NginxMailingListEnglish@forum.nginx.org> References: <875369c24424bd6f71a4658c85bce47b.NginxMailingListEnglish@forum.nginx.org> Message-ID: Thank you, I found out how to access collectd-web cause it has its own webserver. :s Posted at Nginx Forum: http://forum.nginx.org/read.php?2,197100,197988#msg-197988 From nginx-forum at nginx.us Sat May 14 19:16:22 2011 From: nginx-forum at nginx.us (inph) Date: Sat, 14 May 2011 11:16:22 -0400 Subject: nginx 1.0.2 intermittent segfault error 4 Message-ID: <041aa0fb00af03026d71bcb288c84db7.NginxMailingListEnglish@forum.nginx.org> Hi, I've noticed some nginx segfaults over the last week or so with 1.0.1 and 1.0.2. I havent tested any other version for long enough. The segfaults are not immediate and sometimes it requires several hours to reproduce through normal use. Here is the debug info, if you require anymore information please ask. [12702.705897] nginx[1769]: segfault at 50545448 ip 0807d1fa sp bfc241d0 error 4 in nginx[8048000+82000] Linux hostname 2.6.38.6 #1 SMP Sat May 14 09:13:41 UTC 2011 i686 Intel(R) Xeon(TM) CPU 2.40GHz GenuineIntel GNU/Linux # gcc -v Reading specs from /usr/lib/gcc/i486-slackware-linux/4.5.2/specs COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i486-slackware-linux/4.5.2/lto-wrapper Target: i486-slackware-linux Configured with: ../gcc-4.5.2/configure --prefix=/usr --libdir=/usr/lib --mandir=/usr/man --infodir=/usr/info --enable-shared --enable-bootstrap --enable-languages=ada,c,c++,fortran,java,objc,lto --enable-threads=posix --enable-checking=release --with-system-zlib --with-python-dir=/lib/python2.6/site-packages --disable-libunwind-exceptions --enable-__cxa_atexit --enable-libssp --enable-lto --with-gnu-ld --verbose --with-arch=i486 --target=i486-slackware-linux --build=i486-slackware-linux --host=i486-slackware-linux Thread model: posix gcc version 4.5.2 (GCC) # ldd /usr/sbin/nginx linux-gate.so.1 => (0xffffe000) libcrypt.so.1 => /lib/libcrypt.so.1 (0xb77ee000) libpcre.so.0 => /usr/lib/libpcre.so.0 (0xb77b1000) libssl.so.0 => /usr/lib/libssl.so.0 (0xb7769000) libcrypto.so.0 => /usr/lib/libcrypto.so.0 (0xb7623000) libdl.so.2 => /lib/libdl.so.2 (0xb761e000) libz.so.1 => /usr/lib/libz.so.1 (0xb760a000) libc.so.6 => /lib/libc.so.6 (0xb74a7000) /lib/ld-linux.so.2 (0xb782c000) glibc-2.13 pcre-8.12 openssl-0.9.8r zlib-1.2.5 # nginx -V nginx: nginx version: nginx/1.0.2 nginx: TLS SNI support enabled nginx: configure arguments: --with-debug --prefix=/usr --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --user=www --group=www --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_secure_link_module --with-http_stub_status_module --http-client-body-temp-path=/var/lib/nginx/body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --http-scgi-temp-path=/var/lib/nginx/scgi --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module # gdb /usr/sbin/nginx /home/www/core GNU gdb (GDB) 7.2 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-slackware-linux". For bug reporting instructions, please see: ... Reading symbols from /usr/sbin/nginx...(no debugging symbols found)...done. [New Thread 1769] warning: Can't read pathname for load map: Input/output error. Reading symbols from /lib/libcrypt.so.1...(no debugging symbols found)...done. Loaded symbols for /lib/libcrypt.so.1 Reading symbols from /usr/lib/libpcre.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libpcre.so.0 Reading symbols from /usr/lib/libssl.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libssl.so.0 Reading symbols from /usr/lib/libcrypto.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libcrypto.so.0 Reading symbols from /lib/libdl.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/libdl.so.2 Reading symbols from /usr/lib/libz.so.1...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libz.so.1 Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/ld-linux.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/ld-linux.so.2 Reading symbols from /lib/libnss_compat.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/libnss_compat.so.2 Reading symbols from /lib/libnsl.so.1...(no debugging symbols found)...done. Loaded symbols for /lib/libnsl.so.1 Reading symbols from /lib/libnss_nis.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/libnss_nis.so.2 Reading symbols from /lib/libnss_files.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/libnss_files.so.2 Core was generated by `nginx: worker process '. Program terminated with signal 11, Segmentation fault. #0 0x0807d1fa in ?? () (gdb) backtrace #0 0x0807d1fa in ?? () #1 0x080854ac in ?? () #2 0x0807d0c2 in ?? () #3 0x08062f13 in ?? () #4 0x08062a39 in ?? () #5 0x0806a205 in ?? () #6 0x080687c1 in ?? () #7 0x0806a7cc in ?? () #8 0x0806aee7 in ?? () #9 0x0804cea8 in ?? () #10 0xb7491db6 in __libc_start_main () from /lib/libc.so.6 #11 0x0804bc21 in ?? () (gdb) bt full #0 0x0807d1fa in ?? () No symbol table info available. #1 0x080854ac in ?? () No symbol table info available. #2 0x0807d0c2 in ?? () No symbol table info available. #3 0x08062f13 in ?? () No symbol table info available. #4 0x08062a39 in ?? () No symbol table info available. #5 0x0806a205 in ?? () No symbol table info available. #6 0x080687c1 in ?? () No symbol table info available. #7 0x0806a7cc in ?? () No symbol table info available. #8 0x0806aee7 in ?? () No symbol table info available. #9 0x0804cea8 in ?? () No symbol table info available. #10 0xb7491db6 in __libc_start_main () from /lib/libc.so.6 No symbol table info available. #11 0x0804bc21 in ?? () No symbol table info available. (gdb) quit # stat core File: `core' Size: 1515520 Blocks: 2488 IO Block: 4096 regular file Device: 807h/2055d Inode: 18350096 Links: 1 Access: (0600/-rw-------) Uid: ( 48/ www) Gid: ( 48/ www) Access: 2011-05-14 14:08:39.000000000 +0000 Modify: 2011-05-14 14:08:39.000000000 +0000 Change: 2011-05-14 14:08:39.000000000 +0000 Birth: - /var/log/nginx# cat segfault.log|grep "14:08:39" 2011/05/14 14:08:39 [debug] 1768#0: timer delta: 501 2011/05/14 14:08:39 [debug] 1768#0: posted events 00000000 2011/05/14 14:08:39 [debug] 1768#0: worker cycle 2011/05/14 14:08:39 [debug] 1768#0: accept mutex lock failed: 0 2011/05/14 14:08:39 [debug] 1768#0: epoll timer: 500 2011/05/14 14:08:39 [debug] 1769#0: epoll: fd:7 ev:0001 d:08D42248 2011/05/14 14:08:39 [debug] 1769#0: *28081 post event 08D5AF50 2011/05/14 14:08:39 [debug] 1769#0: timer delta: 1797 2011/05/14 14:08:39 [debug] 1769#0: posted events 08D5AF50 2011/05/14 14:08:39 [debug] 1769#0: posted event 08D5AF50 2011/05/14 14:08:39 [debug] 1769#0: *28081 delete posted event 08D5AF50 2011/05/14 14:08:39 [debug] 1769#0: *28081 malloc: 08D31F70:680 2011/05/14 14:08:39 [debug] 1769#0: *28081 malloc: 08D33B18:1024 2011/05/14 14:08:39 [debug] 1769#0: *28081 posix_memalign: 08CFAE70:4096 @16 2011/05/14 14:08:39 [debug] 1769#0: *28081 http process request line 2011/05/14 14:08:39 [debug] 1769#0: *28081 recv: fd:7 536 of 1024 2011/05/14 14:08:39 [debug] 1769#0: *28081 http request line: "POST /index.php?taigachat/list.json HTTP/1.1" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http uri: "/index.php" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http args: "taigachat/list.json" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http exten: "php" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http process request header line 2011/05/14 14:08:39 [debug] 1769#0: *28081 http header: "Host: example.com" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http header: "Connection: keep-alive" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http header: "Referer: http://example.com/forum/" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http header: "Content-Length: 142" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http header: "Origin: http://example.com" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http header: "X-Requested-With: XMLHttpRequest" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http header: "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.24" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http header: "Content-Type: application/x-www-form-urlencoded" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http header: "Accept: application/json, text/javascript, */*; q=0.01" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http header: "Accept-Encoding: gzip,deflate" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http header: "Accept-Language: da-DK,da;q=0.8,en-US;q=0.6,en;q=0.4" 2011/05/14 14:08:39 [debug] 1769#0: *28081 recv: fd:7 -1 of 488 2011/05/14 14:08:39 [debug] 1769#0: *28081 recv() not ready (11: Resource temporarily unavailable) 2011/05/14 14:08:39 [debug] 1769#0: posted event 00000000 2011/05/14 14:08:39 [debug] 1769#0: worker cycle 2011/05/14 14:08:39 [debug] 1769#0: accept mutex locked 2011/05/14 14:08:39 [debug] 1769#0: epoll timer: 58203 2011/05/14 14:08:39 [debug] 1769#0: epoll: fd:7 ev:0001 d:08D42248 2011/05/14 14:08:39 [debug] 1769#0: *28081 post event 08D5AF50 2011/05/14 14:08:39 [debug] 1769#0: timer delta: 128 2011/05/14 14:08:39 [debug] 1769#0: posted events 08D5AF50 2011/05/14 14:08:39 [debug] 1769#0: posted event 08D5AF50 2011/05/14 14:08:39 [debug] 1769#0: *28081 delete posted event 08D5AF50 2011/05/14 14:08:39 [debug] 1769#0: *28081 http process request header line 2011/05/14 14:08:39 [debug] 1769#0: *28081 recv: fd:7 488 of 488 2011/05/14 14:08:39 [debug] 1769#0: *28081 http header: "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http header: "Cookie: __utmz=206500500.1304337103.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); xf_user=1931%2C8b0bad949f0d38b81a46469cb9a941ec05485539; xf_session=53cda77e55ba8e987ba0fb8183cdd326; __utma=206500500.1451942054.1304337103.1305342568.1305355474.64; __utmc=206500500; __utmb=206500500.4.10.1305355474" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http header done 2011/05/14 14:08:39 [debug] 1769#0: *28081 event timer del: 7: 4007086959 2011/05/14 14:08:39 [debug] 1769#0: *28081 generic phase: 0 2011/05/14 14:08:39 [debug] 1769#0: *28081 rewrite phase: 1 2011/05/14 14:08:39 [debug] 1769#0: *28081 test location: "/" 2011/05/14 14:08:39 [debug] 1769#0: *28081 test location: "forum/" 2011/05/14 14:08:39 [debug] 1769#0: *28081 test location: ~ "\.(jpg|jpeg|gif|css|png|js|ico)$" 2011/05/14 14:08:39 [debug] 1769#0: *28081 test location: ~ "\.php$" 2011/05/14 14:08:39 [debug] 1769#0: *28081 using configuration "\.php$" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http cl:142 max:52428800 2011/05/14 14:08:39 [debug] 1769#0: *28081 rewrite phase: 3 2011/05/14 14:08:39 [debug] 1769#0: *28081 post rewrite phase: 4 2011/05/14 14:08:39 [debug] 1769#0: *28081 generic phase: 5 2011/05/14 14:08:39 [debug] 1769#0: *28081 generic phase: 6 2011/05/14 14:08:39 [debug] 1769#0: *28081 generic phase: 7 2011/05/14 14:08:39 [debug] 1769#0: *28081 access phase: 8 2011/05/14 14:08:39 [debug] 1769#0: *28081 access phase: 9 2011/05/14 14:08:39 [debug] 1769#0: *28081 post access phase: 10 2011/05/14 14:08:39 [debug] 1769#0: *28081 try files phase: 11 2011/05/14 14:08:39 [debug] 1769#0: *28081 http client request body preread 137 2011/05/14 14:08:39 [debug] 1769#0: *28081 http read client request body 2011/05/14 14:08:39 [debug] 1769#0: *28081 recv: fd:7 5 of 5 2011/05/14 14:08:39 [debug] 1769#0: *28081 http client request body recv 5 2011/05/14 14:08:39 [debug] 1769#0: *28081 http client request body rest 0 2011/05/14 14:08:39 [debug] 1769#0: *28081 http init upstream, client timer: 0 2011/05/14 14:08:39 [debug] 1769#0: *28081 epoll add event: fd:7 op:3 ev:80000005 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "SCRIPT_FILENAME" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script var: "/home/www/example.com/htdocs" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script var: "/index.php" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "SCRIPT_FILENAME: /home/www/example.com/htdocs/index.php" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "QUERY_STRING" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script var: "taigachat/list.json" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "QUERY_STRING: taigachat/list.json" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "REQUEST_METHOD" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script var: "POST" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "REQUEST_METHOD: POST" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "CONTENT_TYPE" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script var: "application/x-www-form-urlencoded" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "CONTENT_TYPE: application/x-www-form-urlencoded" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "CONTENT_LENGTH" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script var: "142" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "CONTENT_LENGTH: 142" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "SCRIPT_NAME" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script var: "/index.php" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "SCRIPT_NAME: /index.php" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "REQUEST_URI" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script var: "/index.php?taigachat/list.json" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "REQUEST_URI: /index.php?taigachat/list.json" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "DOCUMENT_URI" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script var: "/index.php" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "DOCUMENT_URI: /index.php" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "DOCUMENT_ROOT" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script var: "/home/www/example.com/htdocs" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "DOCUMENT_ROOT: /home/www/example.com/htdocs" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "SERVER_PROTOCOL" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script var: "HTTP/1.1" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "SERVER_PROTOCOL: HTTP/1.1" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "GATEWAY_INTERFACE" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "CGI/1.1" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "GATEWAY_INTERFACE: CGI/1.1" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "SERVER_SOFTWARE" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "nginx/" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script var: "1.0.2" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "SERVER_SOFTWARE: nginx/1.0.2" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "REMOTE_ADDR" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script var: "[REMOTE IP ADDRESS]" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "REMOTE_ADDR: [REMOTE IP ADDRESS]" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "REMOTE_PORT" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script var: "58057" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "REMOTE_PORT: 58057" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "SERVER_ADDR" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script var: "[SERVER IP ADDRESS]" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "SERVER_ADDR: [SERVER IP ADDRESS]" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "SERVER_PORT" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script var: "80" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "SERVER_PORT: 80" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "SERVER_NAME" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script var: "example.com" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "SERVER_NAME: example.com" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "REDIRECT_STATUS" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http script copy: "200" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "REDIRECT_STATUS: 200" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "HTTP_HOST: example.com" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "HTTP_CONNECTION: keep-alive" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "HTTP_REFERER: http://example.com/forum/" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "HTTP_CONTENT_LENGTH: 142" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "HTTP_ORIGIN: http://example.com" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "HTTP_X_REQUESTED_WITH: XMLHttpRequest" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.24" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "HTTP_CONTENT_TYPE: application/x-www-form-urlencoded" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "HTTP_ACCEPT: application/json, text/javascript, */*; q=0.01" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "HTTP_ACCEPT_ENCODING: gzip,deflate" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "HTTP_ACCEPT_LANGUAGE: da-DK,da;q=0.8,en-US;q=0.6,en;q=0.4" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "HTTP_ACCEPT_CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.3" 2011/05/14 14:08:39 [debug] 1769#0: *28081 fastcgi param: "HTTP_COOKIE: __utmz=206500500.1304337103.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); xf_user=1931%2C8b0bad949f0d38b81a46469cb9a941ec05485539; xf_session=53cda77e55ba8e987ba0fb8183cdd326; __utma=206500500.1451942054.1304337103.1305342568.1305355474.64; __utmc=206500500; __utmb=206500500.4.10.1305355474" 2011/05/14 14:08:39 [debug] 1769#0: *28081 posix_memalign: 08CFD490:4096 @16 2011/05/14 14:08:39 [debug] 1769#0: *28081 http cleanup add: 08CFD510 2011/05/14 14:08:39 [debug] 1769#0: *28081 get rr peer, try: 1 2011/05/14 14:08:39 [debug] 1769#0: *28081 socket 9 2011/05/14 14:08:39 [debug] 1769#0: *28081 epoll add connection: fd:9 ev:80000005 2011/05/14 14:08:39 [debug] 1769#0: *28081 connect to unix:/var/run/php-fpm.sock, fd:9 #28082 2011/05/14 14:08:39 [debug] 1769#0: *28081 connected 2011/05/14 14:08:39 [debug] 1769#0: *28081 http upstream connect: 0 2011/05/14 14:08:39 [debug] 1769#0: *28081 http upstream send request 2011/05/14 14:08:39 [debug] 1769#0: *28081 chain writer buf fl:0 s:1448 2011/05/14 14:08:39 [debug] 1769#0: *28081 chain writer buf fl:0 s:137 2011/05/14 14:08:39 [debug] 1769#0: *28081 chain writer buf fl:0 s:15 2011/05/14 14:08:39 [debug] 1769#0: *28081 chain writer buf fl:0 s:5 2011/05/14 14:08:39 [debug] 1769#0: *28081 chain writer buf fl:0 s:11 2011/05/14 14:08:39 [debug] 1769#0: *28081 chain writer in: 08CFD554 2011/05/14 14:08:39 [debug] 1769#0: *28081 writev: 1616 2011/05/14 14:08:39 [debug] 1769#0: *28081 chain writer out: 00000000 2011/05/14 14:08:39 [debug] 1769#0: *28081 event timer add: 9: 180000:4007208884 2011/05/14 14:08:39 [debug] 1769#0: *28081 http finalize request: -4, "/index.php?taigachat/list.json" a:1, c:2 2011/05/14 14:08:39 [debug] 1769#0: *28081 http request count:2 blk:0 2011/05/14 14:08:39 [debug] 1769#0: posted event 00000000 2011/05/14 14:08:39 [debug] 1769#0: worker cycle 2011/05/14 14:08:39 [debug] 1769#0: accept mutex locked 2011/05/14 14:08:39 [debug] 1769#0: epoll timer: 180000 2011/05/14 14:08:39 [debug] 1769#0: epoll: fd:7 ev:0005 d:08D42248 2011/05/14 14:08:39 [debug] 1769#0: *28081 post event 08D5AF50 2011/05/14 14:08:39 [debug] 1769#0: *28081 post event 08D67F58 2011/05/14 14:08:39 [debug] 1769#0: epoll: fd:9 ev:0004 d:08D4243D 2011/05/14 14:08:39 [debug] 1769#0: *28081 post event 08D6805C 2011/05/14 14:08:39 [debug] 1769#0: timer delta: 1 2011/05/14 14:08:39 [debug] 1769#0: posted events 08D6805C 2011/05/14 14:08:39 [debug] 1769#0: posted event 08D6805C 2011/05/14 14:08:39 [debug] 1769#0: *28081 delete posted event 08D6805C 2011/05/14 14:08:39 [debug] 1769#0: *28081 http upstream request: "/index.php?taigachat/list.json" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http upstream dummy handler 2011/05/14 14:08:39 [debug] 1769#0: posted event 08D67F58 2011/05/14 14:08:39 [debug] 1769#0: *28081 delete posted event 08D67F58 2011/05/14 14:08:39 [debug] 1769#0: *28081 http run request: "/index.php?taigachat/list.json" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http request empty handler 2011/05/14 14:08:39 [debug] 1769#0: posted event 08D5AF50 2011/05/14 14:08:39 [debug] 1769#0: *28081 delete posted event 08D5AF50 2011/05/14 14:08:39 [debug] 1769#0: *28081 http run request: "/index.php?taigachat/list.json" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http read client request body 2011/05/14 14:08:39 [debug] 1769#0: *28081 add cleanup: 08CFD63C 2011/05/14 14:08:39 [debug] 1769#0: *28081 hashed path: /var/lib/nginx/body/0000000001 2011/05/14 14:08:39 [debug] 1769#0: *28081 temp fd:13 2011/05/14 14:08:39 [warn] 1769#0: *28081 a client request body is buffered to a temporary file /var/lib/nginx/body/0000000001 while sending request to upstream, client: [REMOTE IP ADDRESS], server: example.com, request: "POST /index.php?taigachat/list.json HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "example.com", referrer: "http://example.com/forum/" 2011/05/14 14:08:39 [debug] 1769#0: *28081 write: 13, 08CFB790, 5, 0 2011/05/14 14:08:39 [debug] 1769#0: *28081 recv: fd:7 0 of 0 2011/05/14 14:08:39 [debug] 1769#0: *28081 http client request body recv 0 2011/05/14 14:08:39 [info] 1769#0: *28081 client closed prematurely connection while sending request to upstream, client: [REMOTE IP ADDRESS], server: example.com, request: "POST /index.php?taigachat/list.json HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "example.com", referrer: "http://example.com/forum/" 2011/05/14 14:08:39 [debug] 1769#0: *28081 http finalize request: 400, "/index.php?taigachat/list.json" a:1, c:1 2011/05/14 14:08:39 [debug] 1769#0: *28081 http terminate request count:1 2011/05/14 14:08:39 [debug] 1769#0: *28081 cleanup http upstream request: "/index.php" 2011/05/14 14:08:39 [debug] 1769#0: *28081 finalize http upstream request: -4 2011/05/14 14:08:39 [debug] 1769#0: *28081 finalize http fastcgi request 2011/05/14 14:08:39 [debug] 1769#0: *28081 free rr peer 1 0 2011/05/14 14:08:39 [debug] 1769#0: *28081 close http upstream connection: 9 2011/05/14 14:08:39 [debug] 1769#0: *28081 event timer del: 9: 4007208884 2011/05/14 14:08:39 [debug] 1769#0: *28081 reusable connection: 0 2011/05/14 14:08:39 [debug] 1769#0: *28081 http finalize request: -4, "/index.php?taigachat/list.json" a:1, c:1 2011/05/14 14:08:39 [debug] 1769#0: *28081 set http keepalive handler 2011/05/14 14:08:39 [debug] 1769#0: *28081 http close request 2011/05/14 14:08:39 [debug] 1769#0: *28081 http log handler 2011/05/14 14:08:39 [debug] 1769#0: *28081 run cleanup: 08CFD63C 2011/05/14 14:08:39 [debug] 1769#0: *28081 file cleanup: fd:13 2011/05/14 14:08:39 [debug] 1769#0: *28081 free: 08CFAE70, unused: 5 2011/05/14 14:08:39 [debug] 1769#0: *28081 free: 08CFD490, unused: 3417 2011/05/14 14:08:39 [debug] 1769#0: *28081 event timer add: 7: 75000:4007103885 2011/05/14 14:08:39 [debug] 1769#0: *28081 free: 08D31F70 2011/05/14 14:08:39 [debug] 1769#0: *28081 free: 08D33B18 2011/05/14 14:08:39 [debug] 1769#0: *28081 hc free: 00000000 0 2011/05/14 14:08:39 [debug] 1769#0: *28081 hc busy: 00000000 0 2011/05/14 14:08:39 [debug] 1769#0: *28081 tcp_nodelay 2011/05/14 14:08:39 [debug] 1769#0: *28081 reusable connection: 1 2011/05/14 14:08:39 [notice] 1767#0: signal 17 (SIGCHLD) received 2011/05/14 14:08:39 [alert] 1767#0: worker process 1769 exited on signal 11 (core dumped) 2011/05/14 14:08:39 [debug] 1767#0: wake up, sigio 0 2011/05/14 14:08:39 [debug] 1767#0: reap children 2011/05/14 14:08:39 [debug] 1767#0: child: 0 1768 e:0 t:0 d:0 r:1 j:0 2011/05/14 14:08:39 [debug] 1767#0: child: 1 1769 e:0 t:1 d:0 r:1 j:0 2011/05/14 14:08:39 [debug] 1767#0: pass close channel s:1 pid:1769 to:1768 2011/05/14 14:08:39 [debug] 1767#0: channel 7:10 2011/05/14 14:08:39 [debug] 1768#0: epoll: fd:9 ev:0001 d:08D41C6C 2011/05/14 14:08:39 [debug] 1768#0: channel handler 2011/05/14 14:08:39 [debug] 1768#0: channel: 16 2011/05/14 14:08:39 [debug] 1768#0: channel command: 2 2011/05/14 14:08:39 [debug] 1768#0: close channel s:1 pid:1769 our:1769 fd:3 2011/05/14 14:08:39 [debug] 1768#0: channel: -2 2011/05/14 14:08:39 [debug] 1768#0: timer delta: 376 2011/05/14 14:08:39 [debug] 1768#0: posted events 00000000 2011/05/14 14:08:39 [debug] 1768#0: worker cycle 2011/05/14 14:08:39 [debug] 1768#0: accept mutex locked 2011/05/14 14:08:39 [debug] 1768#0: epoll add event: fd:8 op:1 ev:00000001 2011/05/14 14:08:39 [debug] 1768#0: epoll timer: 21259 2011/05/14 14:08:39 [notice] 1767#0: start worker process 3483 2011/05/14 14:08:39 [debug] 1767#0: pass channel s:1 pid:3483 fd:7 to s:0 pid:1768 fd:3 2011/05/14 14:08:39 [debug] 1767#0: sigsuspend 2011/05/14 14:08:39 [debug] 1768#0: epoll: fd:9 ev:0001 d:08D41C6C 2011/05/14 14:08:39 [debug] 1768#0: post event 08D5AC44 2011/05/14 14:08:39 [debug] 1768#0: timer delta: 0 2011/05/14 14:08:39 [debug] 1768#0: posted events 08D5AC44 2011/05/14 14:08:39 [debug] 1768#0: posted event 08D5AC44 2011/05/14 14:08:39 [notice] 1767#0: signal 29 (SIGIO) received 2011/05/14 14:08:39 [debug] 1768#0: delete posted event 08D5AC44 2011/05/14 14:08:39 [debug] 1767#0: wake up, sigio 0 2011/05/14 14:08:39 [debug] 1768#0: channel handler 2011/05/14 14:08:39 [debug] 1767#0: sigsuspend 2011/05/14 14:08:39 [debug] 1768#0: channel: 16 2011/05/14 14:08:39 [debug] 1768#0: channel command: 1 2011/05/14 14:08:39 [debug] 1768#0: get channel s:1 pid:3483 fd:3 2011/05/14 14:08:39 [debug] 1768#0: channel: -2 2011/05/14 14:08:39 [debug] 1768#0: posted event 00000000 2011/05/14 14:08:39 [debug] 1768#0: worker cycle 2011/05/14 14:08:39 [debug] 1768#0: accept mutex locked 2011/05/14 14:08:39 [debug] 1768#0: epoll timer: 21259 2011/05/14 14:08:39 [notice] 3483#0: sched_setaffinity(0x0000000A) 2011/05/14 14:08:39 [debug] 3483#0: malloc: 08D0A9F8:6144 2011/05/14 14:08:39 [debug] 3483#0: malloc: 08D41C08:102400 2011/05/14 14:08:39 [debug] 3483#0: malloc: 08D5AC10:53248 2011/05/14 14:08:39 [debug] 3483#0: malloc: 08D67C18:53248 2011/05/14 14:08:39 [debug] 3483#0: epoll add event: fd:10 op:1 ev:00000001 2011/05/14 14:08:39 [debug] 3483#0: setproctitle: "nginx: worker process" 2011/05/14 14:08:39 [debug] 3483#0: worker cycle 2011/05/14 14:08:39 [debug] 3483#0: accept mutex lock failed: 0 2011/05/14 14:08:39 [debug] 3483#0: epoll timer: 500 # cat nginx.conf user www www; worker_processes 2; worker_cpu_affinity 0101 1010; error_log /var/log/nginx/segfault.log debug; #error_log /var/log/nginx/error.log notice; worker_rlimit_core 500M; working_directory /home/www/; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; log_format upstream '$remote_addr - - [$time_local] "$request" $status ' 'upstream $upstream_response_time request $request_time bytes $bytes_sent body_bytes $body_bytes_sent ' '[$host]'; sendfile on; server_tokens off; keepalive_timeout 75; client_max_body_size 50M; gzip on; gzip_proxied any; gzip_vary on; gzip_disable "msie6"; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; fastcgi_max_temp_file_size 0; open_file_cache max=1000 inactive=120s; open_file_cache_valid 120s; open_file_cache_min_uses 5; open_file_cache_errors on; index index.php index.html; include /etc/nginx/enabled/*.conf; } # cat enabled/default.conf server { listen 80 default; server_name _; server_name_in_redirect off; log_format vhost '$host $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/default_vhost.log vhost; root /home/www/default/; location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php-fpm.sock; fastcgi_index index.php; include fastcgi.conf; fastcgi_intercept_errors on; } location ~* \.(jpg|jpeg|gif|css|png|js|ico)$ { log_not_found off; access_log off; expires max; } } # cat enabled/example.com.conf server { server_name www.example.com; rewrite ^ $scheme://example.com$request_uri? permanent; } server { server_name example.com; root /home/www/example.com/htdocs/; location ~* \.(jpg|jpeg|gif|css|png|js|ico)$ { access_log off; expires 30d; } location ^~ /forum/ { rewrite ^/forum/$ /$1? last; rewrite ^/forum/(.+)$ /$1? permanent; } location / { try_files $uri $uri/ /index.php?$uri&$args; } location /blog/ { try_files $uri $uri/ /blog/index.php?$uri&$args; } location ~ \.php$ { try_files $uri =404; access_log /var/log/nginx/upstream.log upstream; fastcgi_pass unix:/var/run/php-fpm.sock; fastcgi_index index.php; include fastcgi.conf; fastcgi_intercept_errors on; fastcgi_ignore_client_abort on; } location ~ /\.ht { access_log off; log_not_found off; deny all; } location ~ /(internal_data|library)/ { allow 127.0.0.1; deny all; } } # cat localhost.conf server { server_name localhost 127.0.0.1; access_log off; root /home/www/default/; location /nginx_status { stub_status on; access_log off; allow 127.0.0.1; deny all; } } # cat fastcgi.conf fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; # PHP only, required if PHP was built with --enable-force-cgi-redirect fastcgi_param REDIRECT_STATUS 200; Also an earlier segfault, however I was not running a error_log at debug at the time. Same nginx build and same config as above. # nginx -V nginx: nginx version: nginx/1.0.2 nginx: TLS SNI support enabled nginx: configure arguments: --with-debug --prefix=/usr --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --user=www --group=www --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_secure_link_module --with-http_stub_status_module --http-client-body-temp-path=/var/lib/nginx/body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --http-scgi-temp-path=/var/lib/nginx/scgi --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module # stat core File: `core' Size: 1490944 Blocks: 2232 IO Block: 4096 regular file Device: 807h/2055d Inode: 18350095 Links: 1 Access: (0600/-rw-------) Uid: ( 48/ www) Gid: ( 48/ www) Access: 2011-05-14 10:14:35.000000000 +0000 Modify: 2011-05-14 10:14:35.000000000 +0000 Change: 2011-05-14 10:14:35.000000000 +0000 Birth: - # gdb /usr/sbin/nginx /home/www/core GNU gdb (GDB) 7.2 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-slackware-linux". For bug reporting instructions, please see: ... Reading symbols from /usr/sbin/nginx...(no debugging symbols found)...done. [New Thread 18354] warning: Can't read pathname for load map: Input/output error. Reading symbols from /lib/libcrypt.so.1...(no debugging symbols found)...done. Loaded symbols for /lib/libcrypt.so.1 Reading symbols from /usr/lib/libpcre.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libpcre.so.0 Reading symbols from /usr/lib/libssl.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libssl.so.0 Reading symbols from /usr/lib/libcrypto.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libcrypto.so.0 Reading symbols from /lib/libdl.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/libdl.so.2 Reading symbols from /usr/lib/libz.so.1...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libz.so.1 Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/ld-linux.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/ld-linux.so.2 Reading symbols from /lib/libnss_compat.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/libnss_compat.so.2 Reading symbols from /lib/libnsl.so.1...(no debugging symbols found)...done. Loaded symbols for /lib/libnsl.so.1 Reading symbols from /lib/libnss_nis.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/libnss_nis.so.2 Reading symbols from /lib/libnss_files.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/libnss_files.so.2 Core was generated by `nginx:'. Program terminated with signal 11, Segmentation fault. #0 0x0807d1fa in ?? () (gdb) bt #0 0x0807d1fa in ?? () #1 0x080854ac in ?? () #2 0x0807d0c2 in ?? () #3 0x08062f13 in ?? () #4 0x08062a39 in ?? () #5 0x0806a205 in ?? () #6 0x080687c1 in ?? () #7 0x0806a7cc in ?? () #8 0x0806aee7 in ?? () #9 0x0804cea8 in ?? () #10 0xb74afdb6 in __libc_start_main () from /lib/libc.so.6 #11 0x0804bc21 in ?? () (gdb) bt full #0 0x0807d1fa in ?? () No symbol table info available. #1 0x080854ac in ?? () No symbol table info available. #2 0x0807d0c2 in ?? () No symbol table info available. #3 0x08062f13 in ?? () No symbol table info available. #4 0x08062a39 in ?? () No symbol table info available. #5 0x0806a205 in ?? () No symbol table info available. #6 0x080687c1 in ?? () No symbol table info available. #7 0x0806a7cc in ?? () No symbol table info available. #8 0x0806aee7 in ?? () No symbol table info available. #9 0x0804cea8 in ?? () No symbol table info available. #10 0xb74afdb6 in __libc_start_main () from /lib/libc.so.6 No symbol table info available. #11 0x0804bc21 in ?? () No symbol table info available. (gdb) quit # error.log 2011/05/14 10:14:35 [warn] 18354#0: *1707 a client request body is buffered to a temporary file /var/lib/nginx/body/0000000001 while sending request to upstream, client: [CLIENT IP ADDRESS], server: example.com, request: "POST /login/csrf-token-refresh HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "example.com", referrer: "http://example.com/threads/THREADNAME.9709/" 2011/05/14 10:14:35 [info] 18354#0: *1707 client closed prematurely connection while sending request to upstream, client: [CLIENT IP ADDRESS], server: example.com, request: "POST /login/csrf-token-refresh HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "example.com", referrer: "http://example.com/threads/THREADNAME.9709/" 2011/05/14 10:14:35 [notice] 18353#0: signal 17 (SIGCHLD) received 2011/05/14 10:14:35 [alert] 18353#0: worker process 18354 exited on signal 11 (core dumped) 2011/05/14 10:14:35 [notice] 18353#0: start worker process 14632 2011/05/14 10:14:35 [notice] 18353#0: signal 29 (SIGIO) received 2011/05/14 10:14:35 [notice] 14632#0: sched_setaffinity(0x0000000A) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198003,198003#msg-198003 From ionathan at gmail.com Sat May 14 19:28:37 2011 From: ionathan at gmail.com (Jonathan Leibiusky) Date: Sat, 14 May 2011 12:28:37 -0300 Subject: nginx worker processes Message-ID: Is it true to say that every worker process in nginx has its own round-robin counters and that they are not aware of the other workers counters? Thanks! Jonathan -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sat May 14 19:46:12 2011 From: nginx-forum at nginx.us (jjjx128) Date: Sat, 14 May 2011 11:46:12 -0400 Subject: nginx worker processes In-Reply-To: References: Message-ID: <8e337b6dcb17affd78b39a148b4fa1bf.NginxMailingListEnglish@forum.nginx.org> Jonathan Leibiusky Wrote: ------------------------------------------------------- > Is it true to say that every worker process in > nginx has its own round-robin > counters and that they are not aware of the other > workers counters? Yes, take a look at ngx_http_upstream_round_robin.c. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198006,198008#msg-198008 From mp3geek at gmail.com Sat May 14 19:48:19 2011 From: mp3geek at gmail.com (Ryan B) Date: Sun, 15 May 2011 03:48:19 +1200 Subject: seperating ipv6 and ipv4 traffic Message-ID: server { server_name secure.mydomain.com; listen 443; gzip on; gzip_comp_level 1; gzip_types text/plain text/html text/css application/x-javascript text/xml text/javascript; gzip_static on; gzip_http_version 1.1; gzip_proxied any; gzip_disable "msie6"; gzip_vary on; ssl on; ssl_ciphers RC4:ALL:-LOW:-EXPORT:!ADH:!MD5; keepalive_timeout 0; ssl_certificate /root/server.pem; ssl_certificate_key /root/ssl.key; location / { root /var/www; index index.html index.htm index.php; } } Seems to work well (and accepts both SSL ipv4/ipv6 since they point to same ip).. But I'd like to move ipv4-only traffic away to another ip. How is this done? I'm guessing I create 2 of these, specifying ipv4 in one and ipv6 in the other? From mp3geek at gmail.com Sat May 14 19:58:01 2011 From: mp3geek at gmail.com (Ryan B) Date: Sun, 15 May 2011 03:58:01 +1200 Subject: seperating ipv6 and ipv4 traffic In-Reply-To: References: Message-ID: Ah, also, with using redirect with a request SSL then redirected to a non-ssl site work? On May 15, 2011 3:48 AM, "Ryan B" wrote: > server { > server_name secure.mydomain.com; > listen 443; > gzip on; > gzip_comp_level 1; > gzip_types text/plain text/html text/css > application/x-javascript text/xml text/javascript; > gzip_static on; > gzip_http_version 1.1; > gzip_proxied any; > gzip_disable "msie6"; > gzip_vary on; > ssl on; > ssl_ciphers RC4:ALL:-LOW:-EXPORT:!ADH:!MD5; > keepalive_timeout 0; > ssl_certificate /root/server.pem; > ssl_certificate_key /root/ssl.key; > > location / { > root /var/www; > index index.html index.htm index.php; > } > > } > > Seems to work well (and accepts both SSL ipv4/ipv6 since they point to > same ip).. > But I'd like to move ipv4-only traffic away to another ip. How is this > done? I'm guessing I create 2 of these, specifying ipv4 in one and > ipv6 in the other? -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sat May 14 20:22:08 2011 From: nginx-forum at nginx.us (jfix) Date: Sat, 14 May 2011 12:22:08 -0400 Subject: gzip compression not taken into account? In-Reply-To: References: Message-ID: <0c89e375c17616d0cdc09c2d633194dd.NginxMailingListEnglish@forum.nginx.org> Thanks for your replies, I will try to provide more information (I'm quite new with nginx). Traffic passes through the company firewall/proxy server, so potentially things could get mangled there. I guess there is no way to inspect the requested headers as received by the server? I set the error_log level to debug_http, but it doesn't seem to log headers. One interesting detail: Using curl and explicitly requesting a compressed response like this, I get this result: M:>curl -v --compressed http://example.org/ * About to connect() to example.org port 80 (#0) * Trying xx.xx.xx.xx... connected * Connected to example.org (xx.xx.xx.xx) port 80 (#0) > GET / HTTP/1.1 > User-Agent: curl/7.19.7 (i386-pc-win32) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3 > Host: example.org > Accept: */* > Accept-Encoding: deflate, gzip > < HTTP/1.1 200 OK < Server: nginx < Date: Sat, 14 May 2011 16:10:06 GMT < Content-Type: text/html; charset=UTF-8 < Transfer-Encoding: chunked < Connection: keep-alive < Vary: Accept-Encoding < Content-Encoding: gzip < 10.107.145.6 - - [14/May/2011:18:10:06 +0000] "GET / HTTP/1.1" 200 2671 "-" "curl/7.19.7 (i386-pc-win32) libcurl/7.19.7 OpenSSL/0.9.81 zlib/1.2.3 "-" "0.031" "2.53" where the last item "2.53" is the compression ratio. M:>curl -v --compressed http://example.org/resource/style/global.css * About to connect() to example.org port 80 (#0) * Trying xx.xx.xx.xx... connected * Connected to example.org (xx.xx.xx.xx) port 80 (#0) > GET /resource/style/global.css HTTP/1.1 > User-Agent: curl/7.19.7 (i386-pc-win32) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3 > Host: example.org > Accept: */* > Accept-Encoding: deflate, gzip > < HTTP/1.1 200 OK < Server: nginx < Date: Sat, 14 May 2011 16:14:38 GMT < Content-Type: text/css < Transfer-Encoding: chunked < Connection: keep-alive < Vary: Accept-Encoding < Last-Modified: Fri, 13 May 2011 16:00:36 GMT < Expires: Thu, 31 Dec 2037 23:55:55 GMT < Cache-Control: max-age=315360000 < Content-Encoding: gzip 10.107.145.6 - - [14/May/2011:18:14:38 +0000] "GET / HTTP/1.1" 200 7917 "-" "curl/7.19.7 (i386-pc-win32) libcurl/7.19.7 OpenSSL/0.9.81 zlib/1.2.3 "-" "0.000" "5.48" So, this means that compression does work in theory, but it doesn't unless I request it. The following example is the same as the previous one, but without the --compressed: M:>curl -v http://example.org/resource/style/global.css * About to connect() to example.org port 80 (#0) * Trying xx.xx.xx.xx... connected * Connected to example.org (xx.xx.xx.xx) port 80 (#0) > GET /resource/style/global.css HTTP/1.1 > User-Agent: curl/7.19.7 (i386-pc-win32) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3 > Host: example.org > Accept: */* > < HTTP/1.1 200 OK < Server: nginx < Date: Sat, 14 May 2011 16:16:59 GMT < Content-Type: text/css < Connection: keep-alive < Vary: Accept-Encoding < Content-Length: 43345 < Last-Modified: Fri, 13 May 2011 16:00:36 GMT < Expires: Thu, 31 Dec 2037 23:55:55 GMT < Cache-Control: max-age=315360000 10.107.145.6 - - [14/May/2011:18:16:59 +0000] "GET / HTTP/1.1" 200 43345 "-" "curl/7.19.7 (i386-pc-win32) libcurl/7.19.7 OpenSSL/0.9.81 zlib/1.2.3 "-" "0.000" "-" I'm not sure what the --compressed option translates to in terms of headers, but it makes a difference. The last examples is what I get when I user a browser (Chrome and Firefox tested). Thanks for your help, Jakob. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,197898,198024#msg-198024 From mat999 at gmail.com Sat May 14 20:23:30 2011 From: mat999 at gmail.com (SplitIce) Date: Sun, 15 May 2011 02:23:30 +1000 Subject: seperating ipv6 and ipv4 traffic In-Reply-To: References: Message-ID: listen on the IPv6 addr. On Sun, May 15, 2011 at 1:58 AM, Ryan B wrote: > Ah, also, with using redirect with a request SSL then redirected to a > non-ssl site work? > On May 15, 2011 3:48 AM, "Ryan B" wrote: > > server { > > server_name secure.mydomain.com; > > listen 443; > > gzip on; > > gzip_comp_level 1; > > gzip_types text/plain text/html text/css > > application/x-javascript text/xml text/javascript; > > gzip_static on; > > gzip_http_version 1.1; > > gzip_proxied any; > > gzip_disable "msie6"; > > gzip_vary on; > > ssl on; > > ssl_ciphers RC4:ALL:-LOW:-EXPORT:!ADH:!MD5; > > keepalive_timeout 0; > > ssl_certificate /root/server.pem; > > ssl_certificate_key /root/ssl.key; > > > > location / { > > root /var/www; > > index index.html index.htm index.php; > > } > > > > } > > > > Seems to work well (and accepts both SSL ipv4/ipv6 since they point to > > same ip).. > > But I'd like to move ipv4-only traffic away to another ip. How is this > > done? I'm guessing I create 2 of these, specifying ipv4 in one and > > ipv6 in the other? > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > > -- Warez Scene Free Rapidshare Downloads -------------- next part -------------- An HTML attachment was scrubbed... URL: From ionathan at gmail.com Sat May 14 21:29:12 2011 From: ionathan at gmail.com (Jonathan Leibiusky) Date: Sat, 14 May 2011 14:29:12 -0300 Subject: nginx worker processes In-Reply-To: <8e337b6dcb17affd78b39a148b4fa1bf.NginxMailingListEnglish@forum.nginx.org> References: <8e337b6dcb17affd78b39a148b4fa1bf.NginxMailingListEnglish@forum.nginx.org> Message-ID: Thanks, it's been a while since I last developed in c, so I wanted someone else's opinion. I saw that there is a fair round-robin module and I also saw that it uses shared memory to store something. Does it mean that using that module counters and servers state (either it is up or down) are shared? On 5/14/11, jjjx128 wrote: > Jonathan Leibiusky Wrote: > ------------------------------------------------------- >> Is it true to say that every worker process in >> nginx has its own round-robin >> counters and that they are not aware of the other >> workers counters? > > Yes, take a look at ngx_http_upstream_round_robin.c. > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,198006,198008#msg-198008 > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > From tomlove at gmail.com Sun May 15 01:36:10 2011 From: tomlove at gmail.com (Thomas Love) Date: Sat, 14 May 2011 23:36:10 +0200 Subject: gzip compression not taken into account? In-Reply-To: <0c89e375c17616d0cdc09c2d633194dd.NginxMailingListEnglish@forum.nginx.org> References: <0c89e375c17616d0cdc09c2d633194dd.NginxMailingListEnglish@forum.nginx.org> Message-ID: The --compressed flag is adding "Accept-Encoding: deflate, gzip" to the request. Your test shows that nginx is working fine. It is compressing the content if it receives an Accept-Encoding: gzip field, and doesn't if not. This is valid behaviour. However, Chrome *should* be sending an Accept-Encoding field just like curl --compressed. You can confirm this using the dev tools. If it is, and you don't get a Content-Encoding: gzip header in the response on Chrome (indicating compression), and if that curl test you performed was run on local interface to nginx, then it is almost certainly an HTTP proxy that's interfering. If otoh, you got those results running the curl test remotely so that it too went through the proxy (a useful confirmation test if you didn't), then I'm not so sure. Cheers Thomas On 14 May 2011 18:22, jfix wrote: > Thanks for your replies, I will try to provide more information (I'm > quite new with nginx). > > Traffic passes through the company firewall/proxy server, so potentially > things could get mangled there. I guess there is no way to inspect the > requested headers as received by the server? I set the error_log level > to debug_http, but it doesn't seem to log headers. > > One interesting detail: Using curl and explicitly requesting a > compressed response like this, I get this result: > > M:>curl -v --compressed http://example.org/ > * About to connect() to example.org port 80 (#0) > * Trying xx.xx.xx.xx... connected > * Connected to example.org (xx.xx.xx.xx) port 80 (#0) > > GET / HTTP/1.1 > > User-Agent: curl/7.19.7 (i386-pc-win32) libcurl/7.19.7 OpenSSL/0.9.8l > zlib/1.2.3 > > Host: example.org > > Accept: */* > > Accept-Encoding: deflate, gzip > > > < HTTP/1.1 200 OK > < Server: nginx > < Date: Sat, 14 May 2011 16:10:06 GMT > < Content-Type: text/html; charset=UTF-8 > < Transfer-Encoding: chunked > < Connection: keep-alive > < Vary: Accept-Encoding > < Content-Encoding: gzip > < > 10.107.145.6 - - [14/May/2011:18:10:06 +0000] "GET / HTTP/1.1" 200 2671 > "-" "curl/7.19.7 (i386-pc-win32) libcurl/7.19.7 OpenSSL/0.9.81 > zlib/1.2.3 "-" "0.031" "2.53" > > where the last item "2.53" is the compression ratio. > > M:>curl -v --compressed http://example.org/resource/style/global.css > * About to connect() to example.org port 80 (#0) > * Trying xx.xx.xx.xx... connected > * Connected to example.org (xx.xx.xx.xx) port 80 (#0) > > GET /resource/style/global.css HTTP/1.1 > > User-Agent: curl/7.19.7 (i386-pc-win32) libcurl/7.19.7 OpenSSL/0.9.8l > zlib/1.2.3 > > Host: example.org > > Accept: */* > > Accept-Encoding: deflate, gzip > > > < HTTP/1.1 200 OK > < Server: nginx > < Date: Sat, 14 May 2011 16:14:38 GMT > < Content-Type: text/css > < Transfer-Encoding: chunked > < Connection: keep-alive > < Vary: Accept-Encoding > < Last-Modified: Fri, 13 May 2011 16:00:36 GMT > < Expires: Thu, 31 Dec 2037 23:55:55 GMT > < Cache-Control: max-age=315360000 > < Content-Encoding: gzip > > 10.107.145.6 - - [14/May/2011:18:14:38 +0000] "GET / HTTP/1.1" 200 7917 > "-" "curl/7.19.7 (i386-pc-win32) libcurl/7.19.7 OpenSSL/0.9.81 > zlib/1.2.3 "-" "0.000" "5.48" > > So, this means that compression does work in theory, but it doesn't > unless I request it. The following example is the same as the previous > one, but without the --compressed: > > M:>curl -v http://example.org/resource/style/global.css > * About to connect() to example.org port 80 (#0) > * Trying xx.xx.xx.xx... connected > * Connected to example.org (xx.xx.xx.xx) port 80 (#0) > > GET /resource/style/global.css HTTP/1.1 > > User-Agent: curl/7.19.7 (i386-pc-win32) libcurl/7.19.7 OpenSSL/0.9.8l > zlib/1.2.3 > > Host: example.org > > Accept: */* > > > < HTTP/1.1 200 OK > < Server: nginx > < Date: Sat, 14 May 2011 16:16:59 GMT > < Content-Type: text/css > < Connection: keep-alive > < Vary: Accept-Encoding > < Content-Length: 43345 > < Last-Modified: Fri, 13 May 2011 16:00:36 GMT > < Expires: Thu, 31 Dec 2037 23:55:55 GMT > < Cache-Control: max-age=315360000 > > 10.107.145.6 - - [14/May/2011:18:16:59 +0000] "GET / HTTP/1.1" 200 43345 > "-" "curl/7.19.7 (i386-pc-win32) libcurl/7.19.7 OpenSSL/0.9.81 > zlib/1.2.3 "-" "0.000" "-" > > I'm not sure what the --compressed option translates to in terms of > headers, but it makes a difference. The last examples is what I get when > I user a browser (Chrome and Firefox tested). > > Thanks for your help, > Jakob. > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,197898,198024#msg-198024 > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sun May 15 01:38:49 2011 From: nginx-forum at nginx.us (the_traveller) Date: Sat, 14 May 2011 17:38:49 -0400 Subject: Rewrite rule for nginx from Apache In-Reply-To: <2507a2f6fd2c5e8a743f33ca869dfa82.NginxMailingListEnglish@forum.nginx.org> References: <72a81ff3e80ed0b4b78cb81a348826cf@ruby-forum.com> <2507a2f6fd2c5e8a743f33ca869dfa82.NginxMailingListEnglish@forum.nginx.org> Message-ID: ;( Posted at Nginx Forum: http://forum.nginx.org/read.php?2,23868,198081#msg-198081 From nginx-forum at nginx.us Sun May 15 01:51:33 2011 From: nginx-forum at nginx.us (jfix) Date: Sat, 14 May 2011 17:51:33 -0400 Subject: gzip compression not taken into account? In-Reply-To: <0c89e375c17616d0cdc09c2d633194dd.NginxMailingListEnglish@forum.nginx.org> References: <0c89e375c17616d0cdc09c2d633194dd.NginxMailingListEnglish@forum.nginx.org> Message-ID: Thanks Thomas for your reply. I've redone the test by explicitly supplying the proxy, and indeed it seems to remove the Accept-encoding header, as even with --compressed option, the response is now uncompressed: M:>curl --compressed -v -x wsg-proxy.example.org:80 http://example.org/resource/style/global.css * About to connect() to proxy wsg-proxy.example.org port 80 (#0) * Trying 10.101.128.15... connected * Connected to wsg-proxy.oecd.org (10.101.128.15) port 80 (#0) > GET http://example.org/resource/style/global.css HTTP/1.1 > User-Agent: curl/7.19.7 (i386-pc-win32) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3 > Host: example.org > Accept: */* > Accept-Encoding: deflate, gzip > Proxy-Connection: Keep-Alive > < HTTP/1.1 200 OK < Server: nginx < Date: Sat, 14 May 2011 21:46:49 GMT < Content-Type: text/css < Vary: Accept-Encoding < Last-Modified: Fri, 13 May 2011 16:00:36 GMT < Expires: Thu, 31 Dec 2037 23:55:55 GMT < Cache-Control: max-age=315360000 < Content-Length: 43345 < Age: 0 < Via: 1.1 localhost.localdomain So, it looks like I have to talk to my company's IT people ... Thanks for your help. Jakob. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,197898,198083#msg-198083 From tomlove at gmail.com Sun May 15 03:25:40 2011 From: tomlove at gmail.com (Thomas Love) Date: Sun, 15 May 2011 01:25:40 +0200 Subject: nginx 1.0.2 intermittent segfault error 4 In-Reply-To: <041aa0fb00af03026d71bcb288c84db7.NginxMailingListEnglish@forum.nginx.org> References: <041aa0fb00af03026d71bcb288c84db7.NginxMailingListEnglish@forum.nginx.org> Message-ID: Hmmm - I'm curious: what's the value of the backtrace without symbol table? How to get one for nginx? -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sun May 15 07:46:41 2011 From: nginx-forum at nginx.us (holstebm) Date: Sat, 14 May 2011 23:46:41 -0400 Subject: add_header works in server but not in http? Message-ID: Hello, I decided I'd clean up my configuration files for Nginx. It's long overdue. I have the following in my nginx.conf but is never sent. I don't have another reference to this header anywhere. add_header X-UA-Compatible 'IE=edge,chrome=1'; Moreover, if I move the line into a Server block, it works fine. Docs say can be used in Http, Server and Location. I'm at a loss. Bret Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198143,198143#msg-198143 From nginx-forum at nginx.us Sun May 15 07:58:26 2011 From: nginx-forum at nginx.us (holstebm) Date: Sat, 14 May 2011 23:58:26 -0400 Subject: add_header works in server but not in http? In-Reply-To: References: Message-ID: <2e52965b4dcd75e917b186825edf2bac.NginxMailingListEnglish@forum.nginx.org> Okay, then, a little more detail. In my Server block, I had an add_header for Cache-control. When I remove that add_header, the other one in Http appears. If I put both in Http they both appear. If I put both in Server they both appear but it seems that the add_header removes the headers from the parent blocks. I don't think that was the previous behavior. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198143,198147#msg-198147 From rschultz7 at gmail.com Sun May 15 15:20:06 2011 From: rschultz7 at gmail.com (Rob Schultz) Date: Sun, 15 May 2011 13:20:06 +0200 Subject: IPv6 issues viewing any static or dynamic file Message-ID: <20024305-77F2-45ED-9D1D-D189407A1C0E@gmail.com> Hello, I am having issues with IPv6 being able to view any files static or dynamic. I keep getting the error curl -6 http://ipv6.example.com/test.png 2011/05/14 16:18:36 [info] 6217#0: *1 client timed out (110: Connection timed out) while sending response to client, client: xxxx:xxx:xxxx:xxxx:xxx:xxxx:xxxx:xxxx, server: example.com, request: "GET /test.png HTTP/1.1", host: "example.com" but i can do HEAD requests and such and get a response. curl -6 -I ipv6.example.com HTTP/1.1 200 OK Server: nginx/1.0.2 Date: Sun, 15 May 2011 08:44:31 GMT Content-Type: text/html Content-Length: 0 Last-Modified: Thu, 24 Jan 2008 19:27:58 GMT Connection: keep-alive Keep-Alive: timeout=10 Accept-Ranges: bytes nginx -V nginx: nginx version: nginx/1.0.2 nginx: TLS SNI support enabled nginx: configure arguments: --prefix=/usr --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error_log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --with-cc-opt=-I/usr/include --with-ld-opt=-L/usr/lib --http-log-path=/var/log/nginx/access_log --http-client-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --http-scgi-temp-path=/var/tmp/nginx/scgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --with-ipv6 --with-pcre --with-http_gzip_static_module --with-http_realip_module --with-http_ssl_module --without-mail_imap_module --without-mail_pop3_module --without-mail_smtp_module and nginx.conf user nginx nginx; worker_processes 2; worker_rlimit_nofile 8192; error_log /var/log/nginx/error_log info; #error_log /var/log/nginx/error_log debug; events { worker_connections 8192; # worker_connections 1024; use epoll; } http { include /etc/nginx/mime.types; # include /etc/nginx/proxy.conf; include /etc/nginx/fastcgi_params; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] ' '"$request" $status $bytes_sent ' '"$http_referer" "$http_user_agent" ' '"$gzip_ratio"'; client_header_timeout 10; client_body_timeout 10; #needed for file uploads > 1m client_max_body_size 10m; send_timeout 10; connection_pool_size 256; client_header_buffer_size 1k; large_client_header_buffers 4 2k; request_pool_size 4k; gzip on; gzip_min_length 1100; gzip_buffers 16 8k; gzip_static on; gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript; output_buffers 1 32k; postpone_output 1460; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 10 10; ignore_invalid_headers on; index index.html index.php; server { listen [::]:80 default ipv6only=on; listen 80 default; server_name example.com www.example.com ipv6.example.com; access_log /var/log/nginx/texample.com.access_log main; error_log /var/log/nginx/example.com.error_log info; root /var/www/example.com/htdocs; autoindex on; location /blog/ { if (!-e $request_filename) { rewrite ^.+?(/.*\.php)$ /blog$1 last; rewrite ^.+?(/wp-.*) /blog$1 last; rewrite ^ /blog/index.php last; } } location ~ ^.+\.php { include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME /var/www/example.com/htdocs$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; } location ~* ^.+\.(jpg|jpeg|gif|png)$ { access_log off; expires 30d; } location ^~ /c/ { return 403; } location ^~ /p/ { return 403; } } include /etc/nginx/vhosts.d/*.conf; } i have turned firewall off to ensure that wasn't an issue. I am not sure were else to look. Here is also a debug log http://pastie.org/private/dbzwwlkxaelmex47hvwnzq v/r, Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor at sysoev.ru Sun May 15 16:26:27 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Sun, 15 May 2011 16:26:27 +0400 Subject: IPv6 issues viewing any static or dynamic file In-Reply-To: <20024305-77F2-45ED-9D1D-D189407A1C0E@gmail.com> References: <20024305-77F2-45ED-9D1D-D189407A1C0E@gmail.com> Message-ID: <20110515122627.GA79835@sysoev.ru> On Sun, May 15, 2011 at 01:20:06PM +0200, Rob Schultz wrote: > Hello, > I am having issues with IPv6 being able to view any files static or dynamic. I keep getting the error > curl -6 http://ipv6.example.com/test.png > > 2011/05/14 16:18:36 [info] 6217#0: *1 client timed out (110: Connection timed out) while sending response to client, client: xxxx:xxx:xxxx:xxxx:xxx:xxxx:xxxx:xxxx, server: example.com, request: "GET /test.png HTTP/1.1", host: "example.com" > > but i can do HEAD requests and such and get a response. > > curl -6 -I ipv6.example.com > HTTP/1.1 200 OK > Server: nginx/1.0.2 > Date: Sun, 15 May 2011 08:44:31 GMT > Content-Type: text/html > Content-Length: 0 > Last-Modified: Thu, 24 Jan 2008 19:27:58 GMT > Connection: keep-alive > Keep-Alive: timeout=10 > Accept-Ranges: bytes How do you connect via IPv6 ? It seems like large packets tunneling issue. Are you able to scp large file via IPv6 ? -- Igor Sysoev From igor at sysoev.ru Sun May 15 16:33:27 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Sun, 15 May 2011 16:33:27 +0400 Subject: seperating ipv6 and ipv4 traffic In-Reply-To: References: Message-ID: <20110515123327.GB79835@sysoev.ru> On Sun, May 15, 2011 at 03:48:19AM +1200, Ryan B wrote: > server { > server_name secure.mydomain.com; > listen 443; > gzip on; > gzip_comp_level 1; > gzip_types text/plain text/html text/css > application/x-javascript text/xml text/javascript; > gzip_static on; > gzip_http_version 1.1; > gzip_proxied any; > gzip_disable "msie6"; > gzip_vary on; > ssl on; > ssl_ciphers RC4:ALL:-LOW:-EXPORT:!ADH:!MD5; > keepalive_timeout 0; > ssl_certificate /root/server.pem; > ssl_certificate_key /root/ssl.key; > > location / { > root /var/www; > index index.html index.htm index.php; > } > > } > > Seems to work well (and accepts both SSL ipv4/ipv6 since they point to > same ip).. > But I'd like to move ipv4-only traffic away to another ip. How is this > done? I'm guessing I create 2 of these, specifying ipv4 in one and > ipv6 in the other? server { listen 192.168.1.1:443; listen [...]:443; -- Igor Sysoev From igor at sysoev.ru Sun May 15 16:34:18 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Sun, 15 May 2011 16:34:18 +0400 Subject: seperating ipv6 and ipv4 traffic In-Reply-To: References: Message-ID: <20110515123418.GC79835@sysoev.ru> On Sun, May 15, 2011 at 03:58:01AM +1200, Ryan B wrote: > Ah, also, with using redirect with a request SSL then redirected to a > non-ssl site work? Sorry, I do not understand the question. -- Igor Sysoev From igor at sysoev.ru Sun May 15 16:50:04 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Sun, 15 May 2011 16:50:04 +0400 Subject: Rewrite rule for nginx from Apache In-Reply-To: References: <72a81ff3e80ed0b4b78cb81a348826cf@ruby-forum.com> <2507a2f6fd2c5e8a743f33ca869dfa82.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110515125004.GD79835@sysoev.ru> On Sat, May 14, 2011 at 05:38:49PM -0400, the_traveller wrote: > ;( Rewrite rules are not configuration means. They are primitive programming language that is too hard to understand. For example, these RewriteRule ^chat/.* pages.php [QSA] RewriteRule ^Songs(.*)$ showcat.php?g=2 [QSA] may be translated to location /maindir/chat/ { fastcgi_pass ... fastcgi_param SCRIPT_FILENAME /path/to/script/pages.php; fastcgi_param QUERY_STRING $args; ... } location /maindir/Songs/ { fastcgi_pass ... fastcgi_param SCRIPT_FILENAME /path/to/script/showcat.php; fastcgi_param QUERY_STRING g=2$is_args$args; ... } -- Igor Sysoev From igor at sysoev.ru Sun May 15 16:52:22 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Sun, 15 May 2011 16:52:22 +0400 Subject: add_header works in server but not in http? In-Reply-To: <2e52965b4dcd75e917b186825edf2bac.NginxMailingListEnglish@forum.nginx.org> References: <2e52965b4dcd75e917b186825edf2bac.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110515125221.GE79835@sysoev.ru> On Sat, May 14, 2011 at 11:58:26PM -0400, holstebm wrote: > Okay, then, a little more detail. In my Server block, I had an > add_header for Cache-control. When I remove that add_header, the other > one in Http appears. If I put both in Http they both appear. If I put > both in Server they both appear but it seems that the add_header removes > the headers from the parent blocks. I don't think that was the previous > behavior. add_header is inherited if there is no add_header on the current level. This behavior was from from the very start. -- Igor Sysoev From nunomagalhaes at eu.ipp.pt Sun May 15 17:46:31 2011 From: nunomagalhaes at eu.ipp.pt (=?UTF-8?Q?Nuno_Magalh=C3=A3es?=) Date: Sun, 15 May 2011 14:46:31 +0100 Subject: Anything wrong with the wiki server? Message-ID: I can connect to nginx.org but not to wiki.nginx.org, times out. From nginx-forum at nginx.us Sun May 15 18:42:34 2011 From: nginx-forum at nginx.us (inph) Date: Sun, 15 May 2011 10:42:34 -0400 Subject: nginx 1.0.2 intermittent segfault error 4 In-Reply-To: <041aa0fb00af03026d71bcb288c84db7.NginxMailingListEnglish@forum.nginx.org> References: <041aa0fb00af03026d71bcb288c84db7.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4c5ea4c84247919300aa51e1226efb52.NginxMailingListEnglish@forum.nginx.org> Sorry, was in a hurry and didnt even notice. nginx compiled with -g and -O0 (previously segfaults above were compiled with -O2) nginx.conf is the same as before. Might be worth noting that this segfault took approximately 12 hours to happen after i recompiled with -g -O0 However this might be down to low traffic between midnight and midday on Sunday. # nginx -V nginx: nginx version: nginx/1.0.2 nginx: TLS SNI support enabled nginx: configure arguments: --with-debug --prefix=/usr --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --user=www --group=www --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_secure_link_module --with-http_stub_status_module --http-client-body-temp-path=/var/lib/nginx/body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --http-scgi-temp-path=/var/lib/nginx/scgi --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module # stat core File: `core' Size: 1359872 Blocks: 2352 IO Block: 4096 regular file Device: 807h/2055d Inode: 18350097 Links: 1 Access: (0600/-rw-------) Uid: ( 48/ www) Gid: ( 48/ www) Access: 2011-05-15 12:41:37.000000000 +0000 Modify: 2011-05-15 12:43:32.000000000 +0000 Change: 2011-05-15 12:43:32.000000000 +0000 Birth: - # gdb /usr/sbin/nginx /home/www/core GNU gdb (GDB) 7.2 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-slackware-linux". For bug reporting instructions, please see: ... Reading symbols from /usr/sbin/nginx...done. [New Thread 9301] warning: Can't read pathname for load map: Input/output error. Reading symbols from /lib/libcrypt.so.1...(no debugging symbols found)...done. Loaded symbols for /lib/libcrypt.so.1 Reading symbols from /usr/lib/libpcre.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libpcre.so.0 Reading symbols from /usr/lib/libssl.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libssl.so.0 Reading symbols from /usr/lib/libcrypto.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libcrypto.so.0 Reading symbols from /lib/libdl.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/libdl.so.2 Reading symbols from /usr/lib/libz.so.1...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libz.so.1 Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/ld-linux.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/ld-linux.so.2 Reading symbols from /lib/libnss_compat.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/libnss_compat.so.2 Reading symbols from /lib/libnsl.so.1...(no debugging symbols found)...done. Loaded symbols for /lib/libnsl.so.1 Reading symbols from /lib/libnss_nis.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/libnss_nis.so.2 Reading symbols from /lib/libnss_files.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/libnss_files.so.2 Core was generated by `nginx:'. Program terminated with signal 11, Segmentation fault. #0 0x08085243 in ngx_http_terminate_request (r=0x8985548, rc=400) at src/http/ngx_http_request.c:2085 2085 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, (gdb) backtrace #0 0x08085243 in ngx_http_terminate_request (r=0x8985548, rc=400) at src/http/ngx_http_request.c:2085 #1 0x08084c91 in ngx_http_finalize_request (r=0x8985548, rc=400) at src/http/ngx_http_request.c:1912 #2 0x0808dab7 in ngx_http_read_client_request_body_handler (r=0x8985548) at src/http/ngx_http_request_body.c:254 #3 0x080849ab in ngx_http_request_handler (ev=0x89ab0ac) at src/http/ngx_http_request.c:1800 #4 0x08067f7b in ngx_event_process_posted (cycle=0x8946cb8, posted=0x80eaaf4) at src/event/ngx_event_posted.c:39 #5 0x08066531 in ngx_process_events_and_timers (cycle=0x8946cb8) at src/event/ngx_event.c:272 #6 0x0807051b in ngx_worker_process_cycle (cycle=0x8946cb8, data=0x0) at src/os/unix/ngx_process_cycle.c:800 #7 0x0806dc5f in ngx_spawn_process (cycle=0x8946cb8, proc=0x807038a , data=0x0, name=0x80d2e2b "worker process", respawn=-3) at src/os/unix/ngx_process.c:196 #8 0x0806f813 in ngx_start_worker_processes (cycle=0x8946cb8, n=2, type=-3) at src/os/unix/ngx_process_cycle.c:360 #9 0x0806f05e in ngx_master_process_cycle (cycle=0x8946cb8) at src/os/unix/ngx_process_cycle.c:136 #10 0x0804c297 in main (argc=1, argv=0xbfdb0fc4) at src/core/nginx.c:405 (gdb) backtrace full #0 0x08085243 in ngx_http_terminate_request (r=0x8985548, rc=400) at src/http/ngx_http_request.c:2085 cln = 0x0 mr = 0x8985548 e = 0x8984dc8 #1 0x08084c91 in ngx_http_finalize_request (r=0x8985548, rc=400) at src/http/ngx_http_request.c:1912 c = 0x8992434 pr = 0x8992434 clcf = 0x894b804 #2 0x0808dab7 in ngx_http_read_client_request_body_handler (r=0x8985548) at src/http/ngx_http_request_body.c:254 rc = 400 #3 0x080849ab in ngx_http_request_handler (ev=0x89ab0ac) at src/http/ngx_http_request.c:1800 c = 0x8992434 r = 0x8985548 ctx = 0x8984df0 #4 0x08067f7b in ngx_event_process_posted (cycle=0x8946cb8, posted=0x80eaaf4) at src/event/ngx_event_posted.c:39 ev = 0x89ab0ac #5 0x08066531 in ngx_process_events_and_timers (cycle=0x8946cb8) at src/event/ngx_event.c:272 flags = 3 timer = 197 delta = 0 #6 0x0807051b in ngx_worker_process_cycle (cycle=0x8946cb8, data=0x0) at src/os/unix/ngx_process_cycle.c:800 i = 9299 c = 0xbfdb0cb8 #7 0x0806dc5f in ngx_spawn_process (cycle=0x8946cb8, proc=0x807038a , data=0x0, name=0x80d2e2b "worker process", respawn=-3) at src/os/unix/ngx_process.c:196 on = 1 pid = 0 s = 1 #8 0x0806f813 in ngx_start_worker_processes (cycle=0x8946cb8, n=2, type=-3) at src/os/unix/ngx_process_cycle.c:360 i = 1 ch = {command = 1, pid = 9300, slot = 0, fd = 3} #9 0x0806f05e in ngx_master_process_cycle (cycle=0x8946cb8) at src/os/unix/ngx_process_cycle.c:136 title = 0x898feb6 "master process nginx" p = 0x898feca "" size = 21 i = 1 n = 143944900 sigio = 0 set = {__val = {0 }} itv = {it_interval = {tv_sec = 135072442, tv_usec = 9299}, it_value = {tv_sec = 0, tv_usec = 0}} live = 0 delay = 0 ls = 0x0 ccf = 0x89474b0 #10 0x0804c297 in main (argc=1, argv=0xbfdb0fc4) at src/core/nginx.c:405 i = 53 log = 0x80e88d0 cycle = 0x8946cb8 init_cycle = {conf_ctx = 0x0, pool = 0x8945dd0, log = 0x80e88d0, new_log = {log_level = 0, file = 0x0, connection = 0, handler = 0, data = 0x0, action = 0x0}, files = 0x0, free_connections = 0x0, free_connection_n = 0, reusable_connections_queue = {prev = 0x0, next = 0x0}, listening = {elts = 0x0, nelts = 0, size = 0, nalloc = 0, pool = 0x0}, pathes = {elts = 0x0, nelts = 0, size = 0, nalloc = 0, pool = 0x0}, open_files = {last = 0x0, part = {elts = 0x0, nelts = 0, next = 0x0}, size = 0, nalloc = 0, pool = 0x0}, shared_memory = {last = 0x0, part = {elts = 0x0, nelts = 0, next = 0x0}, size = 0, nalloc = 0, pool = 0x0}, connection_n = 0, files_n = 0, connections = 0x0, read_events = 0x0, write_events = 0x0, old_cycle = 0x0, conf_file = {len = 21, data = 0x80cf5c2 "/etc/nginx/nginx.conf"}, conf_param = {len = 0, data = 0x0}, conf_prefix = {len = 11, data = 0x80cf5c2 "/etc/nginx/nginx.conf"}, prefix = {len = 5, data = 0x80cf5bc "/usr/"}, lock_file = { len = 0, data = 0x0}, hostname = {len = 0, data = 0x0}} ccf = 0x89474b0 (gdb) quit [93995.665429] nginx[9301]: segfault at 50545448 ip 08085243 sp bfdb0b50 error 4 in nginx[8048000+97000] # cat segfault.log |grep "12:43:32" 2011/05/15 12:43:32 [debug] 9812#0: timer delta: 501 2011/05/15 12:43:32 [debug] 9812#0: posted events 00000000 2011/05/15 12:43:32 [debug] 9812#0: worker cycle 2011/05/15 12:43:32 [debug] 9812#0: accept mutex lock failed: 0 2011/05/15 12:43:32 [debug] 9812#0: epoll timer: 500 2011/05/15 12:43:32 [debug] 9301#0: epoll: fd:10 ev:0001 d:08992435 2011/05/15 12:43:32 [debug] 9301#0: *4558 post event 089AB0AC 2011/05/15 12:43:32 [debug] 9301#0: timer delta: 801 2011/05/15 12:43:32 [debug] 9301#0: posted events 089AB0AC 2011/05/15 12:43:32 [debug] 9301#0: posted event 089AB0AC 2011/05/15 12:43:32 [debug] 9301#0: *4558 delete posted event 089AB0AC 2011/05/15 12:43:32 [debug] 9301#0: *4558 malloc: 08985548:680 2011/05/15 12:43:32 [debug] 9301#0: *4558 malloc: 08983960:1024 2011/05/15 12:43:32 [debug] 9301#0: *4558 posix_memalign: 0894AF70:4096 @16 2011/05/15 12:43:32 [debug] 9301#0: *4558 http process request line 2011/05/15 12:43:32 [debug] 9301#0: *4558 recv: fd:10 536 of 1024 2011/05/15 12:43:32 [debug] 9301#0: *4558 http request line: "POST /index.php?taigachat/list.json HTTP/1.1" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http uri: "/index.php" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http args: "taigachat/list.json" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http exten: "php" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http process request header line 2011/05/15 12:43:32 [debug] 9301#0: *4558 http header: "Host: example.com" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http header: "Connection: keep-alive" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http header: "Referer: http://example.com/forum/" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http header: "Content-Length: 142" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http header: "Origin: http://example.com" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http header: "X-Requested-With: XMLHttpRequest" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http header: "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.24" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http header: "Content-Type: application/x-www-form-urlencoded" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http header: "Accept: application/json, text/javascript, */*; q=0.01" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http header: "Accept-Encoding: gzip,deflate" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http header: "Accept-Language: da-DK,da;q=0.8,en-US;q=0.6,en;q=0.4" 2011/05/15 12:43:32 [debug] 9301#0: *4558 recv: fd:10 -1 of 488 2011/05/15 12:43:32 [debug] 9301#0: *4558 recv() not ready (11: Resource temporarily unavailable) 2011/05/15 12:43:32 [debug] 9301#0: posted event 00000000 2011/05/15 12:43:32 [debug] 9301#0: worker cycle 2011/05/15 12:43:32 [debug] 9301#0: accept mutex locked 2011/05/15 12:43:32 [debug] 9301#0: epoll timer: 210 2011/05/15 12:43:32 [debug] 9301#0: epoll: fd:10 ev:0001 d:08992435 2011/05/15 12:43:32 [debug] 9301#0: *4558 post event 089AB0AC 2011/05/15 12:43:32 [debug] 9301#0: timer delta: 12 2011/05/15 12:43:32 [debug] 9301#0: posted events 089AB0AC 2011/05/15 12:43:32 [debug] 9301#0: posted event 089AB0AC 2011/05/15 12:43:32 [debug] 9301#0: *4558 delete posted event 089AB0AC 2011/05/15 12:43:32 [debug] 9301#0: *4558 http process request header line 2011/05/15 12:43:32 [debug] 9301#0: *4558 recv: fd:10 488 of 488 2011/05/15 12:43:32 [debug] 9301#0: *4558 http header: "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http header: "Cookie: __utmz=206500500.1304337103.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); xf_user=1931%2C8b0bad949f0d38b81a46469cb9a941ec05485539; xf_session=094d80a983afbbd15ac06937d4b23798; __utma=206500500.1451942054.1304337103.1305433729.1305437755.69; __utmc=206500500; __utmb=206500500.3.10.1305437755" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http header done 2011/05/15 12:43:32 [debug] 9301#0: *4558 event timer del: 10: 4088381035 2011/05/15 12:43:32 [debug] 9301#0: *4558 generic phase: 0 2011/05/15 12:43:32 [debug] 9301#0: *4558 rewrite phase: 1 2011/05/15 12:43:32 [debug] 9301#0: *4558 test location: "/" 2011/05/15 12:43:32 [debug] 9301#0: *4558 test location: "forum/" 2011/05/15 12:43:32 [debug] 9301#0: *4558 test location: ~ "\.(jpg|jpeg|gif|css|png|js|ico)$" 2011/05/15 12:43:32 [debug] 9301#0: *4558 test location: ~ "\.php$" 2011/05/15 12:43:32 [debug] 9301#0: *4558 using configuration "\.php$" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http cl:142 max:52428800 2011/05/15 12:43:32 [debug] 9301#0: *4558 rewrite phase: 3 2011/05/15 12:43:32 [debug] 9301#0: *4558 post rewrite phase: 4 2011/05/15 12:43:32 [debug] 9301#0: *4558 generic phase: 5 2011/05/15 12:43:32 [debug] 9301#0: *4558 generic phase: 6 2011/05/15 12:43:32 [debug] 9301#0: *4558 generic phase: 7 2011/05/15 12:43:32 [debug] 9301#0: *4558 access phase: 8 2011/05/15 12:43:32 [debug] 9301#0: *4558 access phase: 9 2011/05/15 12:43:32 [debug] 9301#0: *4558 post access phase: 10 2011/05/15 12:43:32 [debug] 9301#0: *4558 try files phase: 11 2011/05/15 12:43:32 [debug] 9301#0: *4558 http client request body preread 137 2011/05/15 12:43:32 [debug] 9301#0: *4558 http read client request body 2011/05/15 12:43:32 [debug] 9301#0: *4558 recv: fd:10 5 of 5 2011/05/15 12:43:32 [debug] 9301#0: *4558 http client request body recv 5 2011/05/15 12:43:32 [debug] 9301#0: *4558 http client request body rest 0 2011/05/15 12:43:32 [debug] 9301#0: *4558 http init upstream, client timer: 0 2011/05/15 12:43:32 [debug] 9301#0: *4558 epoll add event: fd:10 op:3 ev:80000005 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "SCRIPT_FILENAME" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script var: "/home/www/example.com/htdocs" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script var: "/index.php" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "SCRIPT_FILENAME: /home/www/example.com/htdocs/index.php" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "QUERY_STRING" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script var: "taigachat/list.json" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "QUERY_STRING: taigachat/list.json" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "REQUEST_METHOD" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script var: "POST" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "REQUEST_METHOD: POST" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "CONTENT_TYPE" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script var: "application/x-www-form-urlencoded" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "CONTENT_TYPE: application/x-www-form-urlencoded" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "CONTENT_LENGTH" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script var: "142" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "CONTENT_LENGTH: 142" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "SCRIPT_NAME" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script var: "/index.php" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "SCRIPT_NAME: /index.php" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "REQUEST_URI" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script var: "/index.php?taigachat/list.json" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "REQUEST_URI: /index.php?taigachat/list.json" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "DOCUMENT_URI" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script var: "/index.php" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "DOCUMENT_URI: /index.php" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "DOCUMENT_ROOT" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script var: "/home/www/example.com/htdocs" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "DOCUMENT_ROOT: /home/www/example.com/htdocs" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "SERVER_PROTOCOL" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script var: "HTTP/1.1" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "SERVER_PROTOCOL: HTTP/1.1" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "GATEWAY_INTERFACE" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "CGI/1.1" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "GATEWAY_INTERFACE: CGI/1.1" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "SERVER_SOFTWARE" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "nginx/" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script var: "1.0.2" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "SERVER_SOFTWARE: nginx/1.0.2" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "REMOTE_ADDR" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script var: "[CLIENT IP ADDRESS]" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "REMOTE_ADDR: [CLIENT IP ADDRESS]" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "REMOTE_PORT" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script var: "50294" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "REMOTE_PORT: 50294" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "SERVER_ADDR" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script var: "[SERVER IP ADDRESS]" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "SERVER_ADDR: [SERVER IP ADDRESS]" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "SERVER_PORT" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script var: "80" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "SERVER_PORT: 80" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "SERVER_NAME" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script var: "example.com" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "SERVER_NAME: example.com" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "REDIRECT_STATUS" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http script copy: "200" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "REDIRECT_STATUS: 200" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "HTTP_HOST: example.com" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "HTTP_CONNECTION: keep-alive" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "HTTP_REFERER: http://example.com/forum/" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "HTTP_CONTENT_LENGTH: 142" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "HTTP_ORIGIN: http://example.com" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "HTTP_X_REQUESTED_WITH: XMLHttpRequest" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.24" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "HTTP_CONTENT_TYPE: application/x-www-form-urlencoded" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "HTTP_ACCEPT: application/json, text/javascript, */*; q=0.01" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "HTTP_ACCEPT_ENCODING: gzip,deflate" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "HTTP_ACCEPT_LANGUAGE: da-DK,da;q=0.8,en-US;q=0.6,en;q=0.4" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "HTTP_ACCEPT_CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.3" 2011/05/15 12:43:32 [debug] 9301#0: *4558 fastcgi param: "HTTP_COOKIE: __utmz=206500500.1304337103.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); xf_user=1931%2C8b0bad949f0d38b81a46469cb9a941ec05485539; xf_session=094d80a983afbbd15ac06937d4b23798; __utma=206500500.1451942054.1304337103.1305433729.1305437755.69; __utmc=206500500; __utmb=206500500.3.10.1305437755" 2011/05/15 12:43:32 [debug] 9301#0: *4558 posix_memalign: 0894C380:4096 @16 2011/05/15 12:43:32 [debug] 9301#0: *4558 http cleanup add: 0894C400 2011/05/15 12:43:32 [debug] 9301#0: *4558 get rr peer, try: 1 2011/05/15 12:43:32 [debug] 9301#0: *4558 socket 14 2011/05/15 12:43:32 [debug] 9301#0: *4558 epoll add connection: fd:14 ev:80000005 2011/05/15 12:43:32 [debug] 9301#0: *4558 connect to unix:/var/run/php-fpm.sock, fd:14 #4559 2011/05/15 12:43:32 [debug] 9301#0: *4558 connected 2011/05/15 12:43:32 [debug] 9301#0: *4558 http upstream connect: 0 2011/05/15 12:43:32 [debug] 9301#0: *4558 http upstream send request 2011/05/15 12:43:32 [debug] 9301#0: *4558 chain writer buf fl:0 s:1448 2011/05/15 12:43:32 [debug] 9301#0: *4558 chain writer buf fl:0 s:137 2011/05/15 12:43:32 [debug] 9301#0: *4558 chain writer buf fl:0 s:15 2011/05/15 12:43:32 [debug] 9301#0: *4558 chain writer buf fl:0 s:5 2011/05/15 12:43:32 [debug] 9301#0: *4558 chain writer buf fl:0 s:11 2011/05/15 12:43:32 [debug] 9301#0: *4558 chain writer in: 0894C444 2011/05/15 12:43:32 [debug] 9301#0: *4558 writev: 1616 2011/05/15 12:43:32 [debug] 9301#0: *4558 chain writer out: 00000000 2011/05/15 12:43:32 [debug] 9301#0: *4558 event timer add: 14: 180000:4088501848 2011/05/15 12:43:32 [debug] 9301#0: *4558 http finalize request: -4, "/index.php?taigachat/list.json" a:1, c:2 2011/05/15 12:43:32 [debug] 9301#0: *4558 http request count:2 blk:0 2011/05/15 12:43:32 [debug] 9301#0: posted event 00000000 2011/05/15 12:43:32 [debug] 9301#0: worker cycle 2011/05/15 12:43:32 [debug] 9301#0: accept mutex locked 2011/05/15 12:43:32 [debug] 9301#0: epoll timer: 198 2011/05/15 12:43:32 [debug] 9301#0: epoll: fd:10 ev:0004 d:08992435 2011/05/15 12:43:32 [debug] 9301#0: *4558 post event 089B80B4 2011/05/15 12:43:32 [debug] 9301#0: epoll: fd:14 ev:0004 d:08992F89 2011/05/15 12:43:32 [debug] 9301#0: *4558 post event 089B8698 2011/05/15 12:43:32 [debug] 9301#0: timer delta: 1 2011/05/15 12:43:32 [debug] 9301#0: posted events 089B8698 2011/05/15 12:43:32 [debug] 9301#0: posted event 089B8698 2011/05/15 12:43:32 [debug] 9301#0: *4558 delete posted event 089B8698 2011/05/15 12:43:32 [debug] 9301#0: *4558 http upstream request: "/index.php?taigachat/list.json" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http upstream dummy handler 2011/05/15 12:43:32 [debug] 9301#0: posted event 089B80B4 2011/05/15 12:43:32 [debug] 9301#0: *4558 delete posted event 089B80B4 2011/05/15 12:43:32 [debug] 9301#0: *4558 http run request: "/index.php?taigachat/list.json" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http request empty handler 2011/05/15 12:43:32 [debug] 9301#0: posted event 00000000 2011/05/15 12:43:32 [debug] 9301#0: worker cycle 2011/05/15 12:43:32 [debug] 9301#0: accept mutex locked 2011/05/15 12:43:32 [debug] 9301#0: epoll timer: 197 2011/05/15 12:43:32 [debug] 9301#0: epoll: fd:10 ev:0005 d:08992435 2011/05/15 12:43:32 [debug] 9301#0: *4558 post event 089AB0AC 2011/05/15 12:43:32 [debug] 9301#0: *4558 post event 089B80B4 2011/05/15 12:43:32 [debug] 9301#0: timer delta: 0 2011/05/15 12:43:32 [debug] 9301#0: posted events 089B80B4 2011/05/15 12:43:32 [debug] 9301#0: posted event 089B80B4 2011/05/15 12:43:32 [debug] 9301#0: *4558 delete posted event 089B80B4 2011/05/15 12:43:32 [debug] 9301#0: *4558 http run request: "/index.php?taigachat/list.json" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http request empty handler 2011/05/15 12:43:32 [debug] 9301#0: posted event 089AB0AC 2011/05/15 12:43:32 [debug] 9301#0: *4558 delete posted event 089AB0AC 2011/05/15 12:43:32 [debug] 9301#0: *4558 http run request: "/index.php?taigachat/list.json" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http read client request body 2011/05/15 12:43:32 [debug] 9301#0: *4558 add cleanup: 0894C52C 2011/05/15 12:43:32 [debug] 9301#0: *4558 hashed path: /var/lib/nginx/body/0000000002 2011/05/15 12:43:32 [debug] 9301#0: *4558 temp fd:15 2011/05/15 12:43:32 [warn] 9301#0: *4558 a client request body is buffered to a temporary file /var/lib/nginx/body/0000000002 while sending request to upstream, client: [CLIENT IP ADDRESS], server: example.com, request: "POST /index.php?taigachat/list.json HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "example.com", referrer: "http://example.com/forum/" 2011/05/15 12:43:32 [debug] 9301#0: *4558 write: 15, 0894B890, 5, 0 2011/05/15 12:43:32 [debug] 9301#0: *4558 recv: fd:10 0 of 0 2011/05/15 12:43:32 [debug] 9301#0: *4558 http client request body recv 0 2011/05/15 12:43:32 [info] 9301#0: *4558 client closed prematurely connection while sending request to upstream, client: [CLIENT IP ADDRESS], server: example.com, request: "POST /index.php?taigachat/list.json HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "example.com", referrer: "http://example.com/forum/" 2011/05/15 12:43:32 [debug] 9301#0: *4558 http finalize request: 400, "/index.php?taigachat/list.json" a:1, c:1 2011/05/15 12:43:32 [debug] 9301#0: *4558 http terminate request count:1 2011/05/15 12:43:32 [debug] 9301#0: *4558 cleanup http upstream request: "/index.php" 2011/05/15 12:43:32 [debug] 9301#0: *4558 finalize http upstream request: -4 2011/05/15 12:43:32 [debug] 9301#0: *4558 finalize http fastcgi request 2011/05/15 12:43:32 [debug] 9301#0: *4558 free rr peer 1 0 2011/05/15 12:43:32 [debug] 9301#0: *4558 close http upstream connection: 14 2011/05/15 12:43:32 [debug] 9301#0: *4558 event timer del: 14: 4088501848 2011/05/15 12:43:32 [debug] 9301#0: *4558 reusable connection: 0 2011/05/15 12:43:32 [debug] 9301#0: *4558 http finalize request: -4, "/index.php?taigachat/list.json" a:1, c:1 2011/05/15 12:43:32 [debug] 9301#0: *4558 set http keepalive handler 2011/05/15 12:43:32 [debug] 9301#0: *4558 http close request 2011/05/15 12:43:32 [debug] 9301#0: *4558 http log handler 2011/05/15 12:43:32 [debug] 9301#0: *4558 run cleanup: 0894C52C 2011/05/15 12:43:32 [debug] 9301#0: *4558 file cleanup: fd:15 2011/05/15 12:43:32 [debug] 9301#0: *4558 free: 0894AF70, unused: 5 2011/05/15 12:43:32 [debug] 9301#0: *4558 free: 0894C380, unused: 3417 2011/05/15 12:43:32 [debug] 9301#0: *4558 event timer add: 10: 5000:4088326849 2011/05/15 12:43:32 [debug] 9301#0: *4558 free: 08985548 2011/05/15 12:43:32 [debug] 9301#0: *4558 free: 08983960 2011/05/15 12:43:32 [debug] 9301#0: *4558 hc free: 00000000 0 2011/05/15 12:43:32 [debug] 9301#0: *4558 hc busy: 00000000 0 2011/05/15 12:43:32 [debug] 9301#0: *4558 tcp_nodelay 2011/05/15 12:43:32 [debug] 9301#0: *4558 reusable connection: 1 2011/05/15 12:43:32 [notice] 9299#0: signal 17 (SIGCHLD) received 2011/05/15 12:43:32 [alert] 9299#0: worker process 9301 exited on signal 11 (core dumped) 2011/05/15 12:43:32 [debug] 9299#0: wake up, sigio 0 2011/05/15 12:43:32 [debug] 9299#0: reap children 2011/05/15 12:43:32 [debug] 9299#0: child: 0 9812 e:0 t:0 d:0 r:1 j:0 2011/05/15 12:43:32 [debug] 9299#0: child: 1 9301 e:0 t:1 d:0 r:1 j:0 2011/05/15 12:43:32 [debug] 9299#0: pass close channel s:1 pid:9301 to:9812 2011/05/15 12:43:32 [debug] 9299#0: channel 10:11 2011/05/15 12:43:32 [debug] 9812#0: epoll: fd:9 ev:0001 d:08991D2C 2011/05/15 12:43:32 [debug] 9812#0: channel handler 2011/05/15 12:43:32 [debug] 9812#0: channel: 16 2011/05/15 12:43:32 [debug] 9812#0: channel command: 2 2011/05/15 12:43:32 [debug] 9812#0: close channel s:1 pid:9301 our:9301 fd:10 2011/05/15 12:43:32 [debug] 9812#0: channel: -2 2011/05/15 12:43:32 [debug] 9812#0: timer delta: 112 2011/05/15 12:43:32 [debug] 9812#0: posted events 00000000 2011/05/15 12:43:32 [debug] 9812#0: worker cycle 2011/05/15 12:43:32 [debug] 9812#0: accept mutex locked 2011/05/15 12:43:32 [debug] 9812#0: epoll add event: fd:8 op:1 ev:00000001 2011/05/15 12:43:32 [debug] 9812#0: epoll timer: -1 2011/05/15 12:43:32 [notice] 9299#0: start worker process 9813 2011/05/15 12:43:32 [debug] 9299#0: pass channel s:1 pid:9813 fd:10 to s:0 pid:9812 fd:3 2011/05/15 12:43:32 [debug] 9299#0: sigsuspend 2011/05/15 12:43:32 [debug] 9812#0: epoll: fd:9 ev:0001 d:08991D2C 2011/05/15 12:43:32 [debug] 9812#0: post event 089AAD04 2011/05/15 12:43:32 [debug] 9812#0: timer delta: 1 2011/05/15 12:43:32 [notice] 9299#0: signal 29 (SIGIO) received 2011/05/15 12:43:32 [debug] 9812#0: posted events 089AAD04 2011/05/15 12:43:32 [debug] 9299#0: wake up, sigio 0 2011/05/15 12:43:32 [debug] 9812#0: posted event 089AAD04 2011/05/15 12:43:32 [debug] 9299#0: sigsuspend 2011/05/15 12:43:32 [debug] 9812#0: delete posted event 089AAD04 2011/05/15 12:43:32 [debug] 9812#0: channel handler 2011/05/15 12:43:32 [debug] 9812#0: channel: 16 2011/05/15 12:43:32 [debug] 9812#0: channel command: 1 2011/05/15 12:43:32 [debug] 9812#0: get channel s:1 pid:9813 fd:3 2011/05/15 12:43:32 [debug] 9812#0: channel: -2 2011/05/15 12:43:32 [debug] 9812#0: posted event 00000000 2011/05/15 12:43:32 [debug] 9812#0: worker cycle 2011/05/15 12:43:32 [debug] 9812#0: accept mutex locked 2011/05/15 12:43:32 [debug] 9812#0: epoll timer: -1 2011/05/15 12:43:32 [notice] 9813#0: sched_setaffinity(0x0000000A) 2011/05/15 12:43:32 [debug] 9813#0: malloc: 0895AAA8:6144 2011/05/15 12:43:32 [debug] 9813#0: malloc: 08991CC8:102400 2011/05/15 12:43:32 [debug] 9813#0: malloc: 089AACD0:53248 2011/05/15 12:43:32 [debug] 9813#0: malloc: 089B7CD8:53248 2011/05/15 12:43:32 [debug] 9813#0: epoll add event: fd:11 op:1 ev:00000001 2011/05/15 12:43:32 [debug] 9813#0: setproctitle: "nginx: worker process" 2011/05/15 12:43:32 [debug] 9813#0: worker cycle 2011/05/15 12:43:32 [debug] 9813#0: accept mutex lock failed: 0 2011/05/15 12:43:32 [debug] 9813#0: epoll timer: 500 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198003,198228#msg-198228 From nginx-forum at nginx.us Sun May 15 18:49:34 2011 From: nginx-forum at nginx.us (holstebm) Date: Sun, 15 May 2011 10:49:34 -0400 Subject: add_header works in server but not in http? In-Reply-To: <20110515125221.GE79835@sysoev.ru> References: <20110515125221.GE79835@sysoev.ru> Message-ID: I feel a little foolish. I checked the WIKI and it says "Note that it just appends a new header entry to the output header list." but doesn't say anything about the behavior you describe. I guess I hadn't noted this until I started moving things around so that they make more logical sense in my config files. I had thought add_header to be cumulative from parent to child when the headers were different (i.e. Cache-Control in one block, X-UA-Compatible in another). I didn't mean to waste your time with this. I know this is a huge project and I very much appreciate your hard work. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198143,198231#msg-198231 From nginx-forum at nginx.us Sun May 15 19:44:17 2011 From: nginx-forum at nginx.us (inph) Date: Sun, 15 May 2011 11:44:17 -0400 Subject: nginx 1.0.2 intermittent segfault error 4 In-Reply-To: <4c5ea4c84247919300aa51e1226efb52.NginxMailingListEnglish@forum.nginx.org> References: <041aa0fb00af03026d71bcb288c84db7.NginxMailingListEnglish@forum.nginx.org> <4c5ea4c84247919300aa51e1226efb52.NginxMailingListEnglish@forum.nginx.org> Message-ID: <0ea59159f557484bc42c72eb1ff8f868.NginxMailingListEnglish@forum.nginx.org> During low day time traffic, less than 3 hours after the first segfault above. Same parent nginx process. [93995.665429] nginx[9301]: segfault at 50545448 ip 08085243 sp bfdb0b50 error 4 in nginx[8048000+97000] [103616.200896] nginx[9813]: segfault at 50545448 ip 08085243 sp bfdb0b30 error 4 in nginx[8048000+97000] # stat core File: `core' Size: 1515520 Blocks: 2416 IO Block: 4096 regular file Device: 807h/2055d Inode: 18350098 Links: 1 Access: (0600/-rw-------) Uid: ( 48/ www) Gid: ( 48/ www) Access: 2011-05-15 15:23:53.000000000 +0000 Modify: 2011-05-15 15:23:53.000000000 +0000 Change: 2011-05-15 15:23:53.000000000 +0000 Birth: - # nginx -V nginx: nginx version: nginx/1.0.2 nginx: TLS SNI support enabled nginx: configure arguments: --with-debug --prefix=/usr --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --user=www --group=www --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_secure_link_module --with-http_stub_status_module --http-client-body-temp-path=/var/lib/nginx/body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --http-scgi-temp-path=/var/lib/nginx/scgi --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module # gdb /usr/sbin/nginx /home/www/core GNU gdb (GDB) 7.2 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-slackware-linux". For bug reporting instructions, please see: ... Reading symbols from /usr/sbin/nginx...done. [New Thread 9813] warning: Can't read pathname for load map: Input/output error. [snip no symbols found in libs, identical to previous posts] Core was generated by `nginx:'. Program terminated with signal 11, Segmentation fault. #0 0x08085243 in ngx_http_terminate_request (r=0x894d308, rc=400) at src/http/ngx_http_request.c:2085 2085 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, (gdb) bt #0 0x08085243 in ngx_http_terminate_request (r=0x894d308, rc=400) at src/http/ngx_http_request.c:2085 #1 0x08084c91 in ngx_http_finalize_request (r=0x894d308, rc=400) at src/http/ngx_http_request.c:1912 #2 0x0808dab7 in ngx_http_read_client_request_body_handler (r=0x894d308) at src/http/ngx_http_request_body.c:254 #3 0x080849ab in ngx_http_request_handler (ev=0x89aad38) at src/http/ngx_http_request.c:1800 #4 0x08067f7b in ngx_event_process_posted (cycle=0x8946cb8, posted=0x80eaaf4) at src/event/ngx_event_posted.c:39 #5 0x08066531 in ngx_process_events_and_timers (cycle=0x8946cb8) at src/event/ngx_event.c:272 #6 0x0807051b in ngx_worker_process_cycle (cycle=0x8946cb8, data=0x0) at src/os/unix/ngx_process_cycle.c:800 #7 0x0806dc5f in ngx_spawn_process (cycle=0x8946cb8, proc=0x807038a , data=0x0, name=0x80d2e2b "worker process", respawn=1) at src/os/unix/ngx_process.c:196 #8 0x080700bd in ngx_reap_children (cycle=0x8946cb8) at src/os/unix/ngx_process_cycle.c:617 #9 0x0806f26b in ngx_master_process_cycle (cycle=0x8946cb8) at src/os/unix/ngx_process_cycle.c:180 #10 0x0804c297 in main (argc=1, argv=0xbfdb0fc4) at src/core/nginx.c:405 (gdb) bt full #0 0x08085243 in ngx_http_terminate_request (r=0x894d308, rc=400) at src/http/ngx_http_request.c:2085 cln = 0x0 mr = 0x894d308 e = 0x89850e8 #1 0x08084c91 in ngx_http_finalize_request (r=0x894d308, rc=400) at src/http/ngx_http_request.c:1912 c = 0x8991d90 pr = 0x8991d90 clcf = 0x894deb4 #2 0x0808dab7 in ngx_http_read_client_request_body_handler (r=0x894d308) at src/http/ngx_http_request_body.c:254 rc = 400 #3 0x080849ab in ngx_http_request_handler (ev=0x89aad38) at src/http/ngx_http_request.c:1800 c = 0x8991d90 r = 0x894d308 ctx = 0x8985110 #4 0x08067f7b in ngx_event_process_posted (cycle=0x8946cb8, posted=0x80eaaf4) at src/event/ngx_event_posted.c:39 ev = 0x89aad38 #5 0x08066531 in ngx_process_events_and_timers (cycle=0x8946cb8) at src/event/ngx_event.c:272 flags = 3 timer = 179999 delta = 1 #6 0x0807051b in ngx_worker_process_cycle (cycle=0x8946cb8, data=0x0) at src/os/unix/ngx_process_cycle.c:800 i = 9299 c = 0xbfdb0c98 #7 0x0806dc5f in ngx_spawn_process (cycle=0x8946cb8, proc=0x807038a , data=0x0, name=0x80d2e2b "worker process", respawn=1) at src/os/unix/ngx_process.c:196 on = 1 pid = 0 s = 1 #8 0x080700bd in ngx_reap_children (cycle=0x8946cb8) at src/os/unix/ngx_process_cycle.c:617 i = 1 n = 2 live = 1 ch = {command = 2, pid = 9301, slot = 1, fd = -1} ccf = 0xbfdb0d10 #9 0x0806f26b in ngx_master_process_cycle (cycle=0x8946cb8) at src/os/unix/ngx_process_cycle.c:180 title = 0x898feb6 "master process nginx" p = 0x898feca "" size = 21 i = 1 n = 143944900 sigio = 0 set = {__val = {0 }} itv = {it_interval = {tv_sec = 135072442, tv_usec = 9299}, it_value = {tv_sec = 0, tv_usec = 0}} live = 1 delay = 0 ls = 0x0 ccf = 0x89474b0 #10 0x0804c297 in main (argc=1, argv=0xbfdb0fc4) at src/core/nginx.c:405 i = 53 log = 0x80e88d0 cycle = 0x8946cb8 init_cycle = {conf_ctx = 0x0, pool = 0x8945dd0, log = 0x80e88d0, new_log = {log_level = 0, file = 0x0, connection = 0, handler = 0, data = 0x0, action = 0x0}, files = 0x0, free_connections = 0x0, free_connection_n = 0, reusable_connections_queue = {prev = 0x0, next = 0x0}, listening = {elts = 0x0, nelts = 0, size = 0, nalloc = 0, pool = 0x0}, pathes = {elts = 0x0, nelts = 0, size = 0, nalloc = 0, pool = 0x0}, open_files = {last = 0x0, part = {elts = 0x0, nelts = 0, next = 0x0}, size = 0, nalloc = 0, pool = 0x0}, shared_memory = {last = 0x0, part = {elts = 0x0, nelts = 0, next = 0x0}, size = 0, nalloc = 0, pool = 0x0}, connection_n = 0, files_n = 0, connections = 0x0, read_events = 0x0, write_events = 0x0, old_cycle = 0x0, conf_file = {len = 21, data = 0x80cf5c2 "/etc/nginx/nginx.conf"}, conf_param = {len = 0, data = 0x0}, conf_prefix = {len = 11, data = 0x80cf5c2 "/etc/nginx/nginx.conf"}, prefix = {len = 5, data = 0x80cf5bc "/usr/"}, lock_file = { len = 0, data = 0x0}, hostname = {len = 0, data = 0x0}} ccf = 0x89474b0 (gdb) quit # cat segfault.log |grep "15:23:53" 2011/05/15 15:23:53 [debug] 9813#0: epoll: fd:10 ev:0001 d:08991D91 2011/05/15 15:23:53 [debug] 9813#0: *7244 post event 089AAD38 2011/05/15 15:23:53 [debug] 9813#0: timer delta: 335 2011/05/15 15:23:53 [debug] 9813#0: posted events 089AAD38 2011/05/15 15:23:53 [debug] 9813#0: posted event 089AAD38 2011/05/15 15:23:53 [debug] 9813#0: *7244 delete posted event 089AAD38 2011/05/15 15:23:53 [debug] 9813#0: *7244 http process request header line 2011/05/15 15:23:53 [debug] 9813#0: *7244 recv: fd:10 488 of 488 2011/05/15 15:23:53 [debug] 9813#0: *7244 http header: "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http header: "Cookie: __utmz=206500500.1304337103.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); xf_user=1931%2C8b0bad949f0d38b81a46469cb9a941ec05485539; xf_session=9e29ef01aa56202856bbf74cbae5aed7; __utma=206500500.1451942054.1304337103.1305442622.1305444878.71; __utmc=206500500; __utmb=206500500.7.10.1305444878" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http header done 2011/05/15 15:23:53 [debug] 9813#0: *7244 event timer del: 10: 4097999971 2011/05/15 15:23:53 [debug] 9813#0: *7244 generic phase: 0 2011/05/15 15:23:53 [debug] 9813#0: *7244 rewrite phase: 1 2011/05/15 15:23:53 [debug] 9813#0: *7244 test location: "/" 2011/05/15 15:23:53 [debug] 9813#0: *7244 test location: "forum/" 2011/05/15 15:23:53 [debug] 9813#0: *7244 test location: ~ "\.(jpg|jpeg|gif|css|png|js|ico)$" 2011/05/15 15:23:53 [debug] 9813#0: *7244 test location: ~ "\.php$" 2011/05/15 15:23:53 [debug] 9813#0: *7244 using configuration "\.php$" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http cl:142 max:52428800 2011/05/15 15:23:53 [debug] 9813#0: *7244 rewrite phase: 3 2011/05/15 15:23:53 [debug] 9813#0: *7244 post rewrite phase: 4 2011/05/15 15:23:53 [debug] 9813#0: *7244 generic phase: 5 2011/05/15 15:23:53 [debug] 9813#0: *7244 generic phase: 6 2011/05/15 15:23:53 [debug] 9813#0: *7244 generic phase: 7 2011/05/15 15:23:53 [debug] 9813#0: *7244 access phase: 8 2011/05/15 15:23:53 [debug] 9813#0: *7244 access phase: 9 2011/05/15 15:23:53 [debug] 9813#0: *7244 post access phase: 10 2011/05/15 15:23:53 [debug] 9813#0: *7244 try files phase: 11 2011/05/15 15:23:53 [debug] 9813#0: *7244 http client request body preread 137 2011/05/15 15:23:53 [debug] 9813#0: *7244 http read client request body 2011/05/15 15:23:53 [debug] 9813#0: *7244 recv: fd:10 5 of 5 2011/05/15 15:23:53 [debug] 9813#0: *7244 http client request body recv 5 2011/05/15 15:23:53 [debug] 9813#0: *7244 http client request body rest 0 2011/05/15 15:23:53 [debug] 9813#0: *7244 http init upstream, client timer: 0 2011/05/15 15:23:53 [debug] 9813#0: *7244 epoll add event: fd:10 op:3 ev:80000005 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "SCRIPT_FILENAME" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script var: "/home/www/example.com/htdocs" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script var: "/index.php" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "SCRIPT_FILENAME: /home/www/example.com/htdocs/index.php" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "QUERY_STRING" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script var: "taigachat/list.json" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "QUERY_STRING: taigachat/list.json" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "REQUEST_METHOD" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script var: "POST" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "REQUEST_METHOD: POST" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "CONTENT_TYPE" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script var: "application/x-www-form-urlencoded" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "CONTENT_TYPE: application/x-www-form-urlencoded" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "CONTENT_LENGTH" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script var: "142" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "CONTENT_LENGTH: 142" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "SCRIPT_NAME" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script var: "/index.php" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "SCRIPT_NAME: /index.php" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "REQUEST_URI" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script var: "/index.php?taigachat/list.json" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "REQUEST_URI: /index.php?taigachat/list.json" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "DOCUMENT_URI" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script var: "/index.php" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "DOCUMENT_URI: /index.php" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "DOCUMENT_ROOT" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script var: "/home/www/example.com/htdocs" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "DOCUMENT_ROOT: /home/www/example.com/htdocs" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "SERVER_PROTOCOL" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script var: "HTTP/1.1" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "SERVER_PROTOCOL: HTTP/1.1" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "GATEWAY_INTERFACE" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "CGI/1.1" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "GATEWAY_INTERFACE: CGI/1.1" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "SERVER_SOFTWARE" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "nginx/" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script var: "1.0.2" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "SERVER_SOFTWARE: nginx/1.0.2" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "REMOTE_ADDR" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script var: "[CLIENT IP ADDRESS]" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "REMOTE_ADDR: [CLIENT IP ADDRESS]" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "REMOTE_PORT" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script var: "52898" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "REMOTE_PORT: 52898" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "SERVER_ADDR" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script var: "[SERVER IP ADDRESS]" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "SERVER_ADDR: [SERVER IP ADDRESS]" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "SERVER_PORT" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script var: "80" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "SERVER_PORT: 80" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "SERVER_NAME" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script var: "example.com" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "SERVER_NAME: example.com" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "REDIRECT_STATUS" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http script copy: "200" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "REDIRECT_STATUS: 200" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "HTTP_HOST: example.com" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "HTTP_CONNECTION: keep-alive" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "HTTP_REFERER: http://example.com/forum/" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "HTTP_CONTENT_LENGTH: 142" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "HTTP_ORIGIN: http://example.com" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "HTTP_X_REQUESTED_WITH: XMLHttpRequest" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.24" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "HTTP_CONTENT_TYPE: application/x-www-form-urlencoded" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "HTTP_ACCEPT: application/json, text/javascript, */*; q=0.01" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "HTTP_ACCEPT_ENCODING: gzip,deflate" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "HTTP_ACCEPT_LANGUAGE: da-DK,da;q=0.8,en-US;q=0.6,en;q=0.4" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "HTTP_ACCEPT_CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.3" 2011/05/15 15:23:53 [debug] 9813#0: *7244 fastcgi param: "HTTP_COOKIE: __utmz=206500500.1304337103.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); xf_user=1931%2C8b0bad949f0d38b81a46469cb9a941ec05485539; xf_session=9e29ef01aa56202856bbf74cbae5aed7; __utma=206500500.1451942054.1304337103.1305442622.1305444878.71; __utmc=206500500; __utmb=206500500.7.10.1305444878" 2011/05/15 15:23:53 [debug] 9813#0: *7244 posix_memalign: 0894E640:4096 @16 2011/05/15 15:23:53 [debug] 9813#0: *7244 http cleanup add: 0894E6C0 2011/05/15 15:23:53 [debug] 9813#0: *7244 get rr peer, try: 1 2011/05/15 15:23:53 [debug] 9813#0: *7244 socket 7 2011/05/15 15:23:53 [debug] 9813#0: *7244 epoll add connection: fd:7 ev:80000005 2011/05/15 15:23:53 [debug] 9813#0: *7244 connect to unix:/var/run/php-fpm.sock, fd:7 #7245 2011/05/15 15:23:53 [debug] 9813#0: *7244 connected 2011/05/15 15:23:53 [debug] 9813#0: *7244 http upstream connect: 0 2011/05/15 15:23:53 [debug] 9813#0: *7244 http upstream send request 2011/05/15 15:23:53 [debug] 9813#0: *7244 chain writer buf fl:0 s:1448 2011/05/15 15:23:53 [debug] 9813#0: *7244 chain writer buf fl:0 s:137 2011/05/15 15:23:53 [debug] 9813#0: *7244 chain writer buf fl:0 s:15 2011/05/15 15:23:53 [debug] 9813#0: *7244 chain writer buf fl:0 s:5 2011/05/15 15:23:53 [debug] 9813#0: *7244 chain writer buf fl:0 s:11 2011/05/15 15:23:53 [debug] 9813#0: *7244 chain writer in: 0894E704 2011/05/15 15:23:53 [debug] 9813#0: *7244 writev: 1616 2011/05/15 15:23:53 [debug] 9813#0: *7244 chain writer out: 00000000 2011/05/15 15:23:53 [debug] 9813#0: *7244 event timer add: 7: 180000:4098122382 2011/05/15 15:23:53 [debug] 9813#0: *7244 http finalize request: -4, "/index.php?taigachat/list.json" a:1, c:2 2011/05/15 15:23:53 [debug] 9813#0: *7244 http request count:2 blk:0 2011/05/15 15:23:53 [debug] 9813#0: posted event 00000000 2011/05/15 15:23:53 [debug] 9813#0: worker cycle 2011/05/15 15:23:53 [debug] 9813#0: accept mutex locked 2011/05/15 15:23:53 [debug] 9813#0: epoll timer: 180000 2011/05/15 15:23:53 [debug] 9813#0: epoll: fd:10 ev:0004 d:08991D91 2011/05/15 15:23:53 [debug] 9813#0: *7244 post event 089B7D40 2011/05/15 15:23:53 [debug] 9813#0: epoll: fd:7 ev:0004 d:089920B1 2011/05/15 15:23:53 [debug] 9813#0: *7244 post event 089B7EE0 2011/05/15 15:23:53 [debug] 9813#0: timer delta: 1 2011/05/15 15:23:53 [debug] 9813#0: posted events 089B7EE0 2011/05/15 15:23:53 [debug] 9813#0: posted event 089B7EE0 2011/05/15 15:23:53 [debug] 9813#0: *7244 delete posted event 089B7EE0 2011/05/15 15:23:53 [debug] 9813#0: *7244 http upstream request: "/index.php?taigachat/list.json" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http upstream dummy handler 2011/05/15 15:23:53 [debug] 9813#0: posted event 089B7D40 2011/05/15 15:23:53 [debug] 9813#0: *7244 delete posted event 089B7D40 2011/05/15 15:23:53 [debug] 9813#0: *7244 http run request: "/index.php?taigachat/list.json" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http request empty handler 2011/05/15 15:23:53 [debug] 9813#0: posted event 00000000 2011/05/15 15:23:53 [debug] 9813#0: worker cycle 2011/05/15 15:23:53 [debug] 9813#0: accept mutex locked 2011/05/15 15:23:53 [debug] 9813#0: epoll timer: 179999 2011/05/15 15:23:53 [debug] 9813#0: epoll: fd:10 ev:0005 d:08991D91 2011/05/15 15:23:53 [debug] 9813#0: *7244 post event 089AAD38 2011/05/15 15:23:53 [debug] 9813#0: *7244 post event 089B7D40 2011/05/15 15:23:53 [debug] 9813#0: timer delta: 1 2011/05/15 15:23:53 [debug] 9813#0: posted events 089B7D40 2011/05/15 15:23:53 [debug] 9813#0: posted event 089B7D40 2011/05/15 15:23:53 [debug] 9813#0: *7244 delete posted event 089B7D40 2011/05/15 15:23:53 [debug] 9813#0: *7244 http run request: "/index.php?taigachat/list.json" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http request empty handler 2011/05/15 15:23:53 [debug] 9813#0: posted event 089AAD38 2011/05/15 15:23:53 [debug] 9813#0: *7244 delete posted event 089AAD38 2011/05/15 15:23:53 [debug] 9813#0: *7244 http run request: "/index.php?taigachat/list.json" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http read client request body 2011/05/15 15:23:53 [debug] 9813#0: *7244 add cleanup: 0894E7EC 2011/05/15 15:23:53 [debug] 9813#0: *7244 hashed path: /var/lib/nginx/body/0000000004 2011/05/15 15:23:53 [debug] 9813#0: *7244 temp fd:14 2011/05/15 15:23:53 [warn] 9813#0: *7244 a client request body is buffered to a temporary file /var/lib/nginx/body/0000000004 while sending request to upstream, client: [CLIENT IP ADDRESS], server: example.com, request: "POST /index.php?taigachat/list.json HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "example.com", referrer: "http://example.com/forum/" 2011/05/15 15:23:53 [debug] 9813#0: *7244 write: 14, 0894DF40, 5, 0 2011/05/15 15:23:53 [debug] 9813#0: *7244 recv: fd:10 0 of 0 2011/05/15 15:23:53 [debug] 9813#0: *7244 http client request body recv 0 2011/05/15 15:23:53 [info] 9813#0: *7244 client closed prematurely connection while sending request to upstream, client: [CLIENT IP ADDRESS], server: example.com, request: "POST /index.php?taigachat/list.json HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "example.com", referrer: "http://example.com/forum/" 2011/05/15 15:23:53 [debug] 9813#0: *7244 http finalize request: 400, "/index.php?taigachat/list.json" a:1, c:1 2011/05/15 15:23:53 [debug] 9813#0: *7244 http terminate request count:1 2011/05/15 15:23:53 [debug] 9813#0: *7244 cleanup http upstream request: "/index.php" 2011/05/15 15:23:53 [debug] 9813#0: *7244 finalize http upstream request: -4 2011/05/15 15:23:53 [debug] 9813#0: *7244 finalize http fastcgi request 2011/05/15 15:23:53 [debug] 9813#0: *7244 free rr peer 1 0 2011/05/15 15:23:53 [debug] 9813#0: *7244 close http upstream connection: 7 2011/05/15 15:23:53 [debug] 9813#0: *7244 event timer del: 7: 4098122382 2011/05/15 15:23:53 [debug] 9813#0: *7244 reusable connection: 0 2011/05/15 15:23:53 [debug] 9813#0: *7244 http finalize request: -4, "/index.php?taigachat/list.json" a:1, c:1 2011/05/15 15:23:53 [debug] 9813#0: *7244 set http keepalive handler 2011/05/15 15:23:53 [debug] 9813#0: *7244 http close request 2011/05/15 15:23:53 [debug] 9813#0: *7244 http log handler 2011/05/15 15:23:53 [debug] 9813#0: *7244 run cleanup: 0894E7EC 2011/05/15 15:23:53 [debug] 9813#0: *7244 file cleanup: fd:14 2011/05/15 15:23:53 [debug] 9813#0: *7244 free: 0894D620, unused: 5 2011/05/15 15:23:53 [debug] 9813#0: *7244 free: 0894E640, unused: 3417 2011/05/15 15:23:53 [debug] 9813#0: *7244 event timer add: 10: 5000:4097947384 2011/05/15 15:23:53 [debug] 9813#0: *7244 free: 0894D308 2011/05/15 15:23:53 [debug] 9813#0: *7244 free: 089855B8 2011/05/15 15:23:53 [debug] 9813#0: *7244 hc free: 00000000 0 2011/05/15 15:23:53 [debug] 9813#0: *7244 hc busy: 00000000 0 2011/05/15 15:23:53 [debug] 9813#0: *7244 tcp_nodelay 2011/05/15 15:23:53 [debug] 9813#0: *7244 reusable connection: 1 2011/05/15 15:23:53 [notice] 9299#0: signal 17 (SIGCHLD) received 2011/05/15 15:23:53 [alert] 9299#0: worker process 9813 exited on signal 11 (core dumped) 2011/05/15 15:23:53 [debug] 9299#0: wake up, sigio 0 2011/05/15 15:23:53 [debug] 9299#0: reap children 2011/05/15 15:23:53 [debug] 9299#0: child: 0 9812 e:0 t:0 d:0 r:1 j:0 2011/05/15 15:23:53 [debug] 9299#0: child: 1 9813 e:0 t:1 d:0 r:1 j:0 2011/05/15 15:23:53 [debug] 9299#0: pass close channel s:1 pid:9813 to:9812 2011/05/15 15:23:53 [debug] 9299#0: channel 7:10 2011/05/15 15:23:53 [notice] 9299#0: start worker process 10069 2011/05/15 15:23:53 [debug] 9299#0: pass channel s:1 pid:10069 fd:7 to s:0 pid:9812 fd:3 2011/05/15 15:23:53 [debug] 9299#0: sigsuspend 2011/05/15 15:23:53 [debug] 9812#0: epoll: fd:9 ev:0001 d:08991D2C 2011/05/15 15:23:53 [debug] 9812#0: channel handler 2011/05/15 15:23:53 [debug] 9812#0: channel: 16 2011/05/15 15:23:53 [debug] 9812#0: channel command: 2 2011/05/15 15:23:53 [debug] 9812#0: close channel s:1 pid:9813 our:9813 fd:3 2011/05/15 15:23:53 [debug] 9812#0: channel: 16 2011/05/15 15:23:53 [debug] 9812#0: channel command: 1 2011/05/15 15:23:53 [debug] 9812#0: get channel s:1 pid:10069 fd:3 2011/05/15 15:23:53 [debug] 9812#0: channel: -2 2011/05/15 15:23:53 [debug] 9812#0: timer delta: 243 2011/05/15 15:23:53 [debug] 9812#0: posted events 00000000 2011/05/15 15:23:53 [debug] 9812#0: worker cycle 2011/05/15 15:23:53 [debug] 9812#0: accept mutex locked 2011/05/15 15:23:53 [debug] 9812#0: epoll add event: fd:8 op:1 ev:00000001 2011/05/15 15:23:53 [debug] 9812#0: epoll timer: -1 2011/05/15 15:23:53 [notice] 9299#0: signal 29 (SIGIO) received 2011/05/15 15:23:53 [debug] 9299#0: wake up, sigio 0 2011/05/15 15:23:53 [debug] 9299#0: sigsuspend 2011/05/15 15:23:53 [notice] 10069#0: sched_setaffinity(0x0000000A) 2011/05/15 15:23:53 [debug] 10069#0: malloc: 0895AAA8:6144 2011/05/15 15:23:53 [debug] 10069#0: malloc: 08991CC8:102400 2011/05/15 15:23:53 [debug] 10069#0: malloc: 089AACD0:53248 2011/05/15 15:23:53 [debug] 10069#0: malloc: 089B7CD8:53248 2011/05/15 15:23:53 [debug] 10069#0: epoll add event: fd:10 op:1 ev:00000001 2011/05/15 15:23:53 [debug] 10069#0: setproctitle: "nginx: worker process" 2011/05/15 15:23:53 [debug] 10069#0: worker cycle 2011/05/15 15:23:53 [debug] 10069#0: accept mutex lock failed: 0 2011/05/15 15:23:53 [debug] 10069#0: epoll timer: 500 2011/05/15 15:23:53 [debug] 10069#0: timer delta: 503 2011/05/15 15:23:53 [debug] 10069#0: posted events 00000000 2011/05/15 15:23:53 [debug] 10069#0: worker cycle 2011/05/15 15:23:53 [debug] 10069#0: accept mutex lock failed: 0 2011/05/15 15:23:53 [debug] 10069#0: epoll timer: 500 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198003,198243#msg-198243 From rschultz7 at gmail.com Sun May 15 20:10:53 2011 From: rschultz7 at gmail.com (Rob Schultz) Date: Sun, 15 May 2011 18:10:53 +0200 Subject: IPv6 issues viewing any static or dynamic file In-Reply-To: <20110515122627.GA79835@sysoev.ru> References: <20024305-77F2-45ED-9D1D-D189407A1C0E@gmail.com> <20110515122627.GA79835@sysoev.ru> Message-ID: On May 15, 2011, at 2:26 PM, Igor Sysoev wrote: > > How do you connect via IPv6 ? > It seems like large packets tunneling issue. > Are you able to scp large file via IPv6 ? I am using a 6to4 HE tunnel on the client side and native IPv6 on the server side. (It's hosted at Linode that recently enabled native IPv6) You are right. I created just a test.txt file with just hello world in it and i can browse it just fine. I wonder what google is doing because i can browse ipv6.google.com just fine and other test sights. Just modified my local MTU to 1280 and it seems to be working now. Sorry for the noise. v/r, Rob From igor at sysoev.ru Sun May 15 20:23:16 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Sun, 15 May 2011 20:23:16 +0400 Subject: IPv6 issues viewing any static or dynamic file In-Reply-To: References: <20024305-77F2-45ED-9D1D-D189407A1C0E@gmail.com> <20110515122627.GA79835@sysoev.ru> Message-ID: <20110515162315.GA96402@sysoev.ru> On Sun, May 15, 2011 at 06:10:53PM +0200, Rob Schultz wrote: > > On May 15, 2011, at 2:26 PM, Igor Sysoev wrote: > > > > > How do you connect via IPv6 ? > > It seems like large packets tunneling issue. > > Are you able to scp large file via IPv6 ? > > I am using a 6to4 HE tunnel on the client side and native IPv6 on the server side. (It's hosted at Linode that recently enabled native IPv6) > > You are right. I created just a test.txt file with just hello world in it and i can browse it just fine. I wonder what google is doing because i can browse ipv6.google.com just fine and other test sights. They might decrease MTU on their side to allow pass large response from them to clients. > Just modified my local MTU to 1280 and it seems to be working now. Sorry for the noise. -- Igor Sysoev From nginx-forum at nginx.us Mon May 16 00:45:00 2011 From: nginx-forum at nginx.us (sprasad90) Date: Sun, 15 May 2011 16:45:00 -0400 Subject: async n/w logging In-Reply-To: <4D84CEC7.3030701@chgk.info> References: <4D84CEC7.3030701@chgk.info> Message-ID: <0486dd1a2189b48916d561e9f09c58a7.NginxMailingListEnglish@forum.nginx.org> Hello VT, i am using ubutu 10.4 Lucid and running nginx 0.8.54. I tried patching nginx but it fails. see below. I am trying to use syslog-ng to centralize all the logs to one server. I have had no luck so far. I have tried the patches mentioned here http://wiki.nginx.org/Nginx3rdPartyModules but no luck so far, they all error out. would you have any idea, or point o to a right direction. Thank you! root at nginx-syslog-test:~/nginx-0.8.54# patch -p1 < syslog.patch patching file auto/make patching file auto/options Hunk #1 succeeded at 118 (offset 8 lines). Hunk #2 succeeded at 272 (offset 18 lines). Hunk #3 succeeded at 414 (offset 29 lines). Hunk #4 succeeded at 433 (offset 32 lines). patching file auto/summary Hunk #1 succeeded at 73 with fuzz 1 (offset 2 lines). patching file src/core/nginx.c Hunk #2 succeeded at 283 (offset 9 lines). Hunk #3 succeeded at 409 (offset 19 lines). patching file src/core/ngx_conf_file.c Hunk #1 succeeded at 907 with fuzz 1. patching file src/core/ngx_log.c Hunk #4 FAILED at 447. 1 out of 4 hunks FAILED -- saving rejects to file src/core/ngx_log.c.rej patching file src/http/modules/ngx_http_log_module.c Hunk #4 succeeded at 835 (offset 18 lines). Hunk #5 succeeded at 904 (offset 24 lines). Posted at Nginx Forum: http://forum.nginx.org/read.php?2,183884,198306#msg-198306 From nginx-forum at nginx.us Mon May 16 00:53:33 2011 From: nginx-forum at nginx.us (sprasad90) Date: Sun, 15 May 2011 16:53:33 -0400 Subject: syslog patch: please integrate it in the official release/source In-Reply-To: <99349abca0aa2fdaac0a566af40fe684.NginxMailingListEnglish@forum.nginx.org> References: <99349abca0aa2fdaac0a566af40fe684.NginxMailingListEnglish@forum.nginx.org> Message-ID: <58f505d49c41eaebf31e43392393607a.NginxMailingListEnglish@forum.nginx.org> Hello Daniel, i am using ubutu 10.4 Lucid and running nginx 0.8.54. I tried patching nginx with the patch link you mentioned above but it doesn't work. I have tried all the patches mentioned in http://wiki.nginx.org/Nginx3rdPartyModules but none seem to work. I am trying to use syslog-ng to centralize all the nginx logs to one server. After patching, during make i get this objs/src/os/unix/ngx_process.o: In function `ngx_process_get_status': ngx_process.c:(.text+0xe5d): warning: `sys_errlist' is deprecated; use `strerror' or `strerror_r' instead ngx_process.c:(.text+0xe4b): warning: `sys_nerr' is deprecated; use `strerror' or `strerror_r' instead make[1]: Leaving directory `/root/nginx-0.8.54' and then after a nginx start, the file error.log shows up but access.log is no where to be seen. The error.log doesn't update at all, so basically the logging doesn't happen at all. Any ideas? Any pointers is appreciated. Thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,148108,198309#msg-198309 From cliff at develix.com Mon May 16 05:20:38 2011 From: cliff at develix.com (Cliff Wells) Date: Sun, 15 May 2011 18:20:38 -0700 Subject: Anything wrong with the wiki server? In-Reply-To: References: Message-ID: <1305508838.2371.0.camel@portable-evil> Sorry, had a kernel panic on that system in the wee hours. It's back up now. Cliff On Sun, 2011-05-15 at 14:46 +0100, Nuno Magalh?es wrote: > I can connect to nginx.org but not to wiki.nginx.org, times out. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx From msosno01 at gmail.com Mon May 16 05:48:03 2011 From: msosno01 at gmail.com (Maksim Sosnovskiy) Date: Sun, 15 May 2011 21:48:03 -0400 Subject: no error logging Message-ID: I've added an error_log direction to the nginx.conf file, restarted nginx. However, it's not logging php errors. What could be wrong? -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Mon May 16 06:21:18 2011 From: nginx-forum at nginx.us (jjjx128) Date: Sun, 15 May 2011 22:21:18 -0400 Subject: no error logging In-Reply-To: References: Message-ID: <863bdb753147028c60fe8f63c57b175f.NginxMailingListEnglish@forum.nginx.org> Maksim Sosnovskiy Wrote: ------------------------------------------------------- > I've added an error_log direction to the > nginx.conf file, restarted nginx. > However, it's not logging php errors. What could > be wrong? Make sure your backend sends errors over fastcgi correctly. Although I'm not sure if it is even possible with php. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198357,198362#msg-198362 From nbubingo at gmail.com Mon May 16 07:28:31 2011 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Mon, 16 May 2011 11:28:31 +0800 Subject: syslog patch: please integrate it in the official release/source In-Reply-To: <58f505d49c41eaebf31e43392393607a.NginxMailingListEnglish@forum.nginx.org> References: <99349abca0aa2fdaac0a566af40fe684.NginxMailingListEnglish@forum.nginx.org> <58f505d49c41eaebf31e43392393607a.NginxMailingListEnglish@forum.nginx.org> Message-ID: Try my syslog patch(https://github.com/yaoweibin/nginx_syslog_patch), I have tested it in Nginx-0.8.54 and Nginx-1.0.0. This patch is used in our production servers. 2011/5/16 sprasad90 > Hello Daniel, > > i am using ubutu 10.4 Lucid and running nginx 0.8.54. I tried patching > nginx with the patch link you mentioned above but it doesn't work. I > have tried all the patches mentioned in > http://wiki.nginx.org/Nginx3rdPartyModules but none seem to work. I am > trying to use syslog-ng to centralize all the nginx logs to one server. > > > After patching, during make i get this > > objs/src/os/unix/ngx_process.o: In function `ngx_process_get_status': > ngx_process.c:(.text+0xe5d): warning: `sys_errlist' is deprecated; use > `strerror' or `strerror_r' instead > ngx_process.c:(.text+0xe4b): warning: `sys_nerr' is deprecated; use > `strerror' or `strerror_r' instead > make[1]: Leaving directory `/root/nginx-0.8.54' > > and then after a nginx start, the file error.log shows up but > access.log is no where to be seen. The error.log doesn't update at all, > so basically the logging doesn't happen at all. > > Any ideas? Any pointers is appreciated. > > Thanks! > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,148108,198309#msg-198309 > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mp3geek at gmail.com Mon May 16 08:01:34 2011 From: mp3geek at gmail.com (Ryan B) Date: Mon, 16 May 2011 16:01:34 +1200 Subject: Compiling with a custom SSL library Message-ID: Decided to compile my own copy of openssl (dev snapshot) which is stored in /usr/local/ssl ,...but nginx isn't detecting it :( root at server:/usr/local/ssl# ls -al total 48 drwxr-xr-x 9 root root 4096 2011-05-15 22:15 . drwxr-xr-x 13 root root 4096 2011-05-15 22:13 .. drwxr-xr-x 2 root root 4096 2011-05-15 22:15 bin drwxr-xr-x 2 root root 4096 2011-05-15 22:15 certs drwxr-xr-x 3 root root 4096 2011-05-15 22:15 include drwxr-xr-x 4 root root 4096 2011-05-15 22:15 lib drwxr-xr-x 6 root root 4096 2011-05-15 22:13 man drwxr-xr-x 2 root root 4096 2011-05-15 22:15 misc -rw-r--r-- 1 root root 10819 2011-05-15 22:15 openssl.cnf drwxr-xr-x 2 root root 4096 2011-05-15 22:15 private Tried combinations of --with-openssl=/usr/local/ssl and /usr/local root at server:~/nginx-1.0.2# make make -f objs/Makefile make[1]: Entering directory `/root/nginx-1.0.2' cd /usr/local/ssl \ && make clean \ && ./config --prefix=/usr/local/ssl/.openssl no-shared no-threads \ && make \ && make install LIBDIR=lib make[2]: Entering directory `/usr/local/ssl' make[2]: *** No rule to make target `clean'. Stop. make[2]: Leaving directory `/usr/local/ssl' make[1]: *** [/usr/local/ssl/.openssl/include/openssl/ssl.h] Error 2 make[1]: Leaving directory `/root/nginx-1.0.2' make: *** [build] Error 2 What is the correct ssl dir I need to point it to? From liulantao at gmail.com Mon May 16 08:40:40 2011 From: liulantao at gmail.com (Liu Lantao) Date: Mon, 16 May 2011 12:40:40 +0800 Subject: empty reply from server In-Reply-To: <8977fb6f50245565eaa9b33541fa9413.NginxMailingListEnglish@forum.nginx.org> References: <4cd88446bdeea09b413fae442fa115e7.NginxMailingListEnglish@forum.nginx.org> <8977fb6f50245565eaa9b33541fa9413.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4DD0AAC8.10906@gmail.com> how about this file? include /opt/nginx/conf/location_php.conf; On 05/10/2011 01:18 AM, yellowbox9 wrote: > Nothing is in the vhosts dir.... and I'm not doing anything like : > > error_page 404 =200 /error; > > location /error { > return 444; > } > > Not > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,196075,196789#msg-196789 > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx From mp3geek at gmail.com Mon May 16 08:43:14 2011 From: mp3geek at gmail.com (Ryan B) Date: Mon, 16 May 2011 16:43:14 +1200 Subject: Compiling with a custom SSL library In-Reply-To: References: Message-ID: Okay, managed to "fix" it, by modifying auto/lib/openssl/conf from CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include" CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h" CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a" CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a" to, CORE_INCS="$CORE_INCS $OPENSSL/openssl/include" CORE_DEPS="$CORE_DEPS $OPENSSL/openssl/include/openssl/ssl.h" CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libssl.a" CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libcrypto.a" and link /usr/local/openssl -> /usr/local/ssl On Mon, May 16, 2011 at 4:01 PM, Ryan B wrote: > Decided to compile my own copy of openssl (dev snapshot) which is > stored in /usr/local/ssl ,...but nginx isn't detecting it :( > > root at server:/usr/local/ssl# ls -al > total 48 > drwxr-xr-x ?9 root root ?4096 2011-05-15 22:15 . > drwxr-xr-x 13 root root ?4096 2011-05-15 22:13 .. > drwxr-xr-x ?2 root root ?4096 2011-05-15 22:15 bin > drwxr-xr-x ?2 root root ?4096 2011-05-15 22:15 certs > drwxr-xr-x ?3 root root ?4096 2011-05-15 22:15 include > drwxr-xr-x ?4 root root ?4096 2011-05-15 22:15 lib > drwxr-xr-x ?6 root root ?4096 2011-05-15 22:13 man > drwxr-xr-x ?2 root root ?4096 2011-05-15 22:15 misc > -rw-r--r-- ?1 root root 10819 2011-05-15 22:15 openssl.cnf > drwxr-xr-x ?2 root root ?4096 2011-05-15 22:15 private > > Tried combinations of --with-openssl=/usr/local/ssl and /usr/local > > root at server:~/nginx-1.0.2# make > make -f objs/Makefile > make[1]: Entering directory `/root/nginx-1.0.2' > cd /usr/local/ssl \ > ? ? ? ?&& make clean \ > ? ? ? ?&& ./config --prefix=/usr/local/ssl/.openssl no-shared ?no-threads \ > ? ? ? ?&& make \ > ? ? ? ?&& make install LIBDIR=lib > make[2]: Entering directory `/usr/local/ssl' > make[2]: *** No rule to make target `clean'. ?Stop. > make[2]: Leaving directory `/usr/local/ssl' > make[1]: *** [/usr/local/ssl/.openssl/include/openssl/ssl.h] Error 2 > make[1]: Leaving directory `/root/nginx-1.0.2' > make: *** [build] Error 2 > > What is the correct ssl dir I need to point it to? > From igor at sysoev.ru Mon May 16 09:06:49 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Mon, 16 May 2011 09:06:49 +0400 Subject: Compiling with a custom SSL library In-Reply-To: References: Message-ID: <20110516050649.GA24536@sysoev.ru> On Mon, May 16, 2011 at 04:01:34PM +1200, Ryan B wrote: > Decided to compile my own copy of openssl (dev snapshot) which is > stored in /usr/local/ssl ,...but nginx isn't detecting it :( > > root at server:/usr/local/ssl# ls -al > total 48 > drwxr-xr-x 9 root root 4096 2011-05-15 22:15 . > drwxr-xr-x 13 root root 4096 2011-05-15 22:13 .. > drwxr-xr-x 2 root root 4096 2011-05-15 22:15 bin > drwxr-xr-x 2 root root 4096 2011-05-15 22:15 certs > drwxr-xr-x 3 root root 4096 2011-05-15 22:15 include > drwxr-xr-x 4 root root 4096 2011-05-15 22:15 lib > drwxr-xr-x 6 root root 4096 2011-05-15 22:13 man > drwxr-xr-x 2 root root 4096 2011-05-15 22:15 misc > -rw-r--r-- 1 root root 10819 2011-05-15 22:15 openssl.cnf > drwxr-xr-x 2 root root 4096 2011-05-15 22:15 private > > Tried combinations of --with-openssl=/usr/local/ssl and /usr/local > > root at server:~/nginx-1.0.2# make > make -f objs/Makefile > make[1]: Entering directory `/root/nginx-1.0.2' > cd /usr/local/ssl \ > && make clean \ > && ./config --prefix=/usr/local/ssl/.openssl no-shared no-threads \ > && make \ > && make install LIBDIR=lib > make[2]: Entering directory `/usr/local/ssl' > make[2]: *** No rule to make target `clean'. Stop. > make[2]: Leaving directory `/usr/local/ssl' > make[1]: *** [/usr/local/ssl/.openssl/include/openssl/ssl.h] Error 2 > make[1]: Leaving directory `/root/nginx-1.0.2' > make: *** [build] Error 2 > > What is the correct ssl dir I need to point it to? ./configure --help | grep openssl= --with-openssl=DIR set path to OpenSSL library sources The sources, but not pre-built installation. wget http://openssl.org/source/openssl-1.0.0d.tar.gz tar zxf openssl-1.0.0d.tar.gz cd nginx-1.0.2 ./configure --with-openssl=../openssl-1.0.0d ... -- Igor Sysoev From nunomagalhaes at eu.ipp.pt Mon May 16 12:21:32 2011 From: nunomagalhaes at eu.ipp.pt (=?UTF-8?Q?Nuno_Magalh=C3=A3es?=) Date: Mon, 16 May 2011 09:21:32 +0100 Subject: Gzip vs Gzip static Message-ID: Hi, This may be a silly question, but, does gzip static depend/extend gzip, or can i just compile with gzip static and without gzip? I would assume either gzip or gzip+static, but i'd like to confirm. Thanks, Nuno From igor at sysoev.ru Mon May 16 12:25:19 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Mon, 16 May 2011 12:25:19 +0400 Subject: Gzip vs Gzip static In-Reply-To: References: Message-ID: <20110516082519.GC33895@sysoev.ru> On Mon, May 16, 2011 at 09:21:32AM +0100, Nuno Magalh?es wrote: > Hi, > > This may be a silly question, but, does gzip static depend/extend > gzip, or can i just compile with gzip static and without gzip? I would > assume either gzip or gzip+static, but i'd like to confirm. gzip_static does not depend on gzip filter. You can use gzip_static without compiled gzip filter. -- Igor Sysoev From Pekka.Panula at sofor.fi Mon May 16 14:14:27 2011 From: Pekka.Panula at sofor.fi (Pekka.Panula at sofor.fi) Date: Mon, 16 May 2011 13:14:27 +0300 Subject: Got timeout problems, even with 1.0.2, without old patches, reverse proxy with cache features Message-ID: Hi Even with 1.0.2 version i am needed to patch these 2 patches: http://nginx.org/pipermail/nginx-devel/2010-January/000100.html Because i am getting timeouts without those 2 patch. My backend is IBM Lotus Domino and these are cases where body is 0 bytes but there is redirection / location on headers, it seems nginx on default stalled (when using cache features), it does not close connection between client and nginx. Seems to be fixed if i patch nginx with those patches, perhaps integrate them to nginx permanently? Terveisin/Regards, Pekka Panula, Sofor Oy - Jatkuvat palvelut -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Mon May 16 14:29:24 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 16 May 2011 14:29:24 +0400 Subject: Got timeout problems, even with 1.0.2, without old patches, reverse proxy with cache features In-Reply-To: References: Message-ID: <20110516102924.GE42265@mdounin.ru> Hello! On Mon, May 16, 2011 at 01:14:27PM +0300, Pekka.Panula at sofor.fi wrote: > Hi > > Even with 1.0.2 version i am needed to patch these 2 patches: > http://nginx.org/pipermail/nginx-devel/2010-January/000100.html > Because i am getting timeouts without those 2 patch. My backend is IBM > Lotus Domino and these are cases where body is 0 bytes but there is > redirection / location on headers, it seems nginx on default stalled (when > using cache features), it does not close connection between client and > nginx. > > Seems to be fixed if i patch nginx with those patches, perhaps integrate > them to nginx permanently? JFYI, more recent versions of these patches may be found here: http://nginx.org/pipermail/nginx-devel/2011-February/000743.html http://nginx.org/pipermail/nginx-devel/2011-February/000744.html Maxim Dounin From mdounin at mdounin.ru Mon May 16 15:08:34 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 16 May 2011 15:08:34 +0400 Subject: gzip compression not taken into account? In-Reply-To: References: <0c89e375c17616d0cdc09c2d633194dd.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110516110834.GG42265@mdounin.ru> Hello! On Sat, May 14, 2011 at 05:51:33PM -0400, jfix wrote: > Thanks Thomas for your reply. > > I've redone the test by explicitly supplying the proxy, and indeed it > seems to remove the Accept-encoding header, as even with --compressed > option, the response is now uncompressed: > > M:>curl --compressed -v -x wsg-proxy.example.org:80 > http://example.org/resource/style/global.css > * About to connect() to proxy wsg-proxy.example.org port 80 (#0) > * Trying 10.101.128.15... connected > * Connected to wsg-proxy.oecd.org (10.101.128.15) port 80 (#0) > > GET http://example.org/resource/style/global.css HTTP/1.1 > > User-Agent: curl/7.19.7 (i386-pc-win32) libcurl/7.19.7 OpenSSL/0.9.8l > zlib/1.2.3 > > Host: example.org > > Accept: */* > > Accept-Encoding: deflate, gzip > > Proxy-Connection: Keep-Alive > > > < HTTP/1.1 200 OK > < Server: nginx > < Date: Sat, 14 May 2011 21:46:49 GMT > < Content-Type: text/css > < Vary: Accept-Encoding > < Last-Modified: Fri, 13 May 2011 16:00:36 GMT > < Expires: Thu, 31 Dec 2037 23:55:55 GMT > < Cache-Control: max-age=315360000 > < Content-Length: 43345 > < Age: 0 > < Via: 1.1 localhost.localdomain > > So, it looks like I have to talk to my company's IT people ... Thanks > for your help. Please note that by default nginx only returns compressed response to HTTP/1.1 requests. By using proxy you may be in fact using HTTP/1.0 in request to nginx. Additionally, nginx will look though request headers to find out if request was from proxy, and by default won't return compressed response to proxies. With gzip_proxied as set in your config it won't return response in question compressed as well. See here for more details: http://wiki.nginx.org/HttpGzipModule#gzip_http_version http://wiki.nginx.org/HttpGzipModule#gzip_proxied Please also note that unconditionally enabling gzip for everything may not be a good idea. If enabling gzip for proxied requests, please at least make sure that (a) gzip_vary set to on and (b) gzip for HTTP/1.0 is disabled (default). Maxim Dounin From nginx-forum at nginx.us Mon May 16 15:29:33 2011 From: nginx-forum at nginx.us (jfix) Date: Mon, 16 May 2011 07:29:33 -0400 Subject: gzip compression not taken into account? In-Reply-To: <20110516110834.GG42265@mdounin.ru> References: <20110516110834.GG42265@mdounin.ru> Message-ID: <6ef2bc692a4a9c4f02e0c9a85855623a.NginxMailingListEnglish@forum.nginx.org> Hi Maxim, thanks for your input. I had, in the meantime, added the directives gzip_http_version 1.0 gzip_vary on Does the fact that the response contains this header Via:1.1 localhost.localdomain mean that HTTP 1.1 is being used? Having changed temporarily the gzip_proxied directive to gzip_proxied any hasn't changed a thing, unfortunately. I will look in more detail at the gzip_proxied values and see how they are applicable or not. Thanks, Jakob. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,197898,198433#msg-198433 From mdounin at mdounin.ru Mon May 16 15:33:12 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 16 May 2011 15:33:12 +0400 Subject: Keepalived Connections Reset after reloading the configuration (HUP Signal) In-Reply-To: <46781f68e473c0d6a12e4a3e9788a38e.NginxMailingListEnglish@forum.nginx.org> References: <46781f68e473c0d6a12e4a3e9788a38e.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110516113312.GH42265@mdounin.ru> Hello! On Fri, May 13, 2011 at 07:24:12PM -0400, Jocelyn Mocquant wrote: > Hello, > > I'm dealing with a problem. When reloading the nginx configuration, > all keepalived connections receive the TCP reset flag after I send a > HUP signal to the master process. If I comment the line responsible for > enabling the keepalive feature in the configuration, the problem > disappear (nginx version is 0.9.7). On configuration reloading nginx starts new worker processes with new configuration and old worker processes are terminated as soon as they finish processing of requests. All keepalive connections in old workers are closed accordingly. HTTP/1.1 clients are required to handle keepalive connection close, so this shoudln't be a problem. It's not clear why you see RST instead of normal close with FIN/FIN+ACK/ACK (are you?), but this shouldn't the problem by itself anyway. Maxim Dounin From tomlove at gmail.com Mon May 16 17:57:43 2011 From: tomlove at gmail.com (Thomas Love) Date: Mon, 16 May 2011 15:57:43 +0200 Subject: gzip compression not taken into account? In-Reply-To: <6ef2bc692a4a9c4f02e0c9a85855623a.NginxMailingListEnglish@forum.nginx.org> References: <20110516110834.GG42265@mdounin.ru> <6ef2bc692a4a9c4f02e0c9a85855623a.NginxMailingListEnglish@forum.nginx.org> Message-ID: That you've added those directives with no fix makes me more confident that your proxy is simply not forwarding your Accept-Encoding: gzip header. I'm not sure if nginx can log request headers, but if you have it configured for PHP, you can request a simple test script: var_dump($_SERVER["HTTP_ACCEPT_ENCODING"]); Thomas On 16 May 2011 13:29, jfix wrote: > Hi Maxim, thanks for your input. > > I had, in the meantime, added the directives > > gzip_http_version 1.0 > gzip_vary on > > > Does the fact that the response contains this header > > Via:1.1 localhost.localdomain > > mean that HTTP 1.1 is being used? Having changed temporarily the > gzip_proxied directive to > > gzip_proxied any > > hasn't changed a thing, unfortunately. I will look in more detail at > the gzip_proxied values and see how they are applicable or not. > > Thanks, > Jakob. > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,197898,198433#msg-198433 > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Mon May 16 18:25:35 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 16 May 2011 18:25:35 +0400 Subject: nginx 1.0.2 intermittent segfault error 4 In-Reply-To: <041aa0fb00af03026d71bcb288c84db7.NginxMailingListEnglish@forum.nginx.org> References: <041aa0fb00af03026d71bcb288c84db7.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110516142535.GK42265@mdounin.ru> Hello! On Sat, May 14, 2011 at 11:16:22AM -0400, inph wrote: > Hi, > > I've noticed some nginx segfaults over the last week or so with 1.0.1 > and 1.0.2. I havent tested any other version for long enough. > The segfaults are not immediate and sometimes it requires several hours > to reproduce through normal use. > > Here is the debug info, if you require anymore information please ask. > > [12702.705897] nginx[1769]: segfault at 50545448 ip 0807d1fa sp bfc241d0 > error 4 in nginx[8048000+82000] [...] > location ~ \.php$ { > try_files $uri =404; > access_log /var/log/nginx/upstream.log upstream; > fastcgi_pass unix:/var/run/php-fpm.sock; > fastcgi_index index.php; > include fastcgi.conf; > fastcgi_intercept_errors on; > fastcgi_ignore_client_abort on; Yes, thank you for your report. The problem is with fastcgi_ignore_client_abort, it doesn't handle POST requests correctly. Switching fastcgi_ignore_client_abort back to default (off) should resolve this issue. Maxim Dounin From jocelyn.mocquant at gmail.com Tue May 17 02:12:05 2011 From: jocelyn.mocquant at gmail.com (Jocelyn) Date: Mon, 16 May 2011 15:12:05 -0700 Subject: Keepalived Connections Reset after reloading the configuration (HUP Signal) In-Reply-To: <20110516113312.GH42265@mdounin.ru> References: <46781f68e473c0d6a12e4a3e9788a38e.NginxMailingListEnglish@forum.nginx.org> <20110516113312.GH42265@mdounin.ru> Message-ID: Thanks Maxim for your answer, If I remove the keep alive directive, all happens as expected. Apparently, sending USR2 and WINCH solve the problem. -- Regards Jocelyn On Mon, May 16, 2011 at 4:33 AM, Maxim Dounin wrote: > Hello! > > On Fri, May 13, 2011 at 07:24:12PM -0400, Jocelyn Mocquant wrote: > > > Hello, > > > > I'm dealing with a problem. When reloading the nginx configuration, > > all keepalived connections receive the TCP reset flag after I send a > > HUP signal to the master process. If I comment the line responsible for > > enabling the keepalive feature in the configuration, the problem > > disappear (nginx version is 0.9.7). > > On configuration reloading nginx starts new worker processes with > new configuration and old worker processes are terminated as soon > as they finish processing of requests. All keepalive connections > in old workers are closed accordingly. HTTP/1.1 clients are > required to handle keepalive connection close, so this shoudln't > be a problem. > > It's not clear why you see RST instead of normal close with > FIN/FIN+ACK/ACK (are you?), but this shouldn't the problem by > itself anyway. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Tue May 17 04:01:55 2011 From: nginx-forum at nginx.us (George) Date: Mon, 16 May 2011 20:01:55 -0400 Subject: Compiling with a custom SSL library In-Reply-To: <20110516050649.GA24536@sysoev.ru> References: <20110516050649.GA24536@sysoev.ru> Message-ID: <8ae970b3654f137ab8bb7cd163c614f9.NginxMailingListEnglish@forum.nginx.org> thanks Igor that helped me with my custom nginx 1.0.2 + php-fpm openssl 1.0.0d install as well :) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198369,198600#msg-198600 From nginx-forum at nginx.us Tue May 17 10:58:53 2011 From: nginx-forum at nginx.us (Mike_1) Date: Tue, 17 May 2011 02:58:53 -0400 Subject: smtp proxy to external smtp server Message-ID: Hi all Can nginx used as smtp proxy connecting to an external smtp server? The external smtp server requires smtp auth. -- Thanks Mike Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198667,198667#msg-198667 From lists at ruby-forum.com Tue May 17 18:31:45 2011 From: lists at ruby-forum.com (Antoine L.) Date: Tue, 17 May 2011 16:31:45 +0200 Subject: 504 error Gateway Timeout. In-Reply-To: References: Message-ID: <4724c2b955f220f6f9cfde53e5ca0e5e@ruby-forum.com> Hi guys, I have the exactly same issue. What about include proxy.inc ? Those are my values : 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; Use it with Magento on a VPS and always need to restart APACHE Thanks for the help, Antoine -- Posted via http://www.ruby-forum.com/. From nginx-forum at nginx.us Tue May 17 20:33:14 2011 From: nginx-forum at nginx.us (arleybls) Date: Tue, 17 May 2011 12:33:14 -0400 Subject: Profiling NGINX Message-ID: <7af7092b35bc728bf38cf1582c0e452e.NginxMailingListEnglish@forum.nginx.org> Hello all, I need to profile nginx+own_module. I've being trying to use gprof, but even tough compiling along with --with-cc-opt="-pg" --with-ld-opt="-pg" the gmon.out is not being generated. Any ideas? Cheers, AB Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198795,198795#msg-198795 From nginx-forum at nginx.us Tue May 17 21:25:11 2011 From: nginx-forum at nginx.us (arleybls) Date: Tue, 17 May 2011 13:25:11 -0400 Subject: Profiling NGINX In-Reply-To: <7af7092b35bc728bf38cf1582c0e452e.NginxMailingListEnglish@forum.nginx.org> References: <7af7092b35bc728bf38cf1582c0e452e.NginxMailingListEnglish@forum.nginx.org> Message-ID: arleybls Wrote: ------------------------------------------------------- > Hello all, > > I need to profile nginx+own_module. I've being > trying to use gprof, but even tough compiling > along with --with-cc-opt="-pg" --with-ld-opt="-pg" > the gmon.out is not being generated. > > Any ideas? > > Cheers, > AB Nerve mind, running manually along with "daemon off;" and "master_process off;" did the trick. Ty, AB Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198795,198812#msg-198812 From nginx-forum at nginx.us Tue May 17 22:05:41 2011 From: nginx-forum at nginx.us (lkmcmillen) Date: Tue, 17 May 2011 14:05:41 -0400 Subject: CanNginx Mail Server replace Postfix to listen only? Message-ID: <8f18130d95dc425c4b1bb8fb940f0c85.NginxMailingListEnglish@forum.nginx.org> Can the Nginx mail server be used in replacement of Postfix? I am a bit new to this. However, I have a small, fully functioning, unmanaged VPS server, rented from Linode.com, which is setup as a LEMP server, running Ubuntu 11.04, Nginx 1.0.2, MariaDB 5.2.6, PHP 5.3.6 (PHP-FPM), xcache 1.3.1, vBulletin 4.1.2, and Postfix which was setup using the following script: ########################################################### # Postfix ########################################################### # Installs postfix and configure to listen only on the local interface. Also # allows for local mail delivery { echo "postfix postfix/main_mailer_type select Internet Site" | debconf-set-selections echo "postfix postfix/mailname string localhost" | debconf-set-selections echo "postfix postfix/destinations string localhost.localdomain, localhost" | debconf-set-selections aptitude -y install postfix /usr/sbin/postconf -e "inet_interfaces = loopback-only" #/usr/sbin/postconf -e "local_transport = error:local delivery is disabled" touch /tmp/restart-postfix } ############################################################ Can the Nginx mail server be used in the same manner in replacement of Postfix? If so: (1) Is there good reason not to use the Nginx mail server in such a manner? (2) What do I need to do in order to use the Nginx mail server instead of Postfix? As a matter of information, I recently subscribed to Google Apps for the hosted domain. We need Postfix, or the Nginx mail server, only to send and receive email from our web applications. Thank you. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198821,198821#msg-198821 From igor at sysoev.ru Tue May 17 22:39:12 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 17 May 2011 22:39:12 +0400 Subject: CanNginx Mail Server replace Postfix to listen only? In-Reply-To: <8f18130d95dc425c4b1bb8fb940f0c85.NginxMailingListEnglish@forum.nginx.org> References: <8f18130d95dc425c4b1bb8fb940f0c85.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110517183912.GA18234@sysoev.ru> On Tue, May 17, 2011 at 02:05:41PM -0400, lkmcmillen wrote: > Can the Nginx mail server be used in replacement of Postfix? No. -- Igor Sysoev From mitchell.hashimoto at gmail.com Wed May 18 00:14:30 2011 From: mitchell.hashimoto at gmail.com (Mitchell Hashimoto) Date: Tue, 17 May 2011 13:14:30 -0700 Subject: Conditionally set header in proxy Message-ID: Hello, I'm doing SSL termination in nginx, and I'd like to set a header such as "X-Sheme https" ONLY if X-Scheme is not set. The reason is because an upstream load balancer may have terminated SSL as well, and I don't want to overwrite that value. Is this possible? Best, Mitchell -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Wed May 18 02:51:33 2011 From: nginx-forum at nginx.us (the_traveller) Date: Tue, 17 May 2011 18:51:33 -0400 Subject: Rewrite rule for nginx from Apache In-Reply-To: <2507a2f6fd2c5e8a743f33ca869dfa82.NginxMailingListEnglish@forum.nginx.org> References: <72a81ff3e80ed0b4b78cb81a348826cf@ruby-forum.com> <2507a2f6fd2c5e8a743f33ca869dfa82.NginxMailingListEnglish@forum.nginx.org> Message-ID: First of all thank you very much mr Igor This is a great help for me but as i'm new to nginx so i'm little bit careful but i have afew more things to ask about do i have to make any defination to these params SCRIPT_FILENAME maindir which is used as fastcgi_param SCRIPT_FILENAME /path/to/script/pages.php; AND location /maindir/chat/ Or they just have to be written as they are?? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,23868,198889#msg-198889 From nginx-forum at nginx.us Wed May 18 08:09:34 2011 From: nginx-forum at nginx.us (arti) Date: Wed, 18 May 2011 00:09:34 -0400 Subject: File AIO and multiple nginx instances Message-ID: Hello. I need to run two nginx instances on one server (not two workers, but two master processes with their own number of workers each). The problem is that when nginx is compiled with aio support I can start only one instance. When I try to start the second one, only master process starts and these lines appear in error log: [emerg] 12789#0: io_setup() failed (1: Operation not permitted) ... [alert] 12715#0: worker process 12789 exited with fatal code 2 and can not be respawn ... This happens even if aio directive isn't used in configuration. My system is CentOS 5.5 with kernel 2.6.18-194.32.1.el5, I've tried nginx 1.0.0 and nginx 1.0.2 So, is it expected behavior (I don't know nginx and/or aio internals), or is it a bug in nginx or aio, and is there a way to start two nginx instances, both with aio support? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198945,198945#msg-198945 From igor at sysoev.ru Wed May 18 08:43:36 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 18 May 2011 08:43:36 +0400 Subject: Conditionally set header in proxy In-Reply-To: References: Message-ID: <20110518044336.GA45611@sysoev.ru> On Tue, May 17, 2011 at 01:14:30PM -0700, Mitchell Hashimoto wrote: > Hello, > > I'm doing SSL termination in nginx, and I'd like to set a header such as > "X-Sheme https" ONLY if X-Scheme is not set. The reason is because an > upstream load balancer may have terminated SSL as well, and I don't want to > overwrite that value. > > Is this possible? nginx-0.9.0+: http { map $http_x_scheme $x_scheme { "" https; default $http_x_scheme; } server { location / { proxy_set_header X-Scheme $x_scheme; -- Igor Sysoev From nginx-forum at nginx.us Wed May 18 09:13:39 2011 From: nginx-forum at nginx.us (felka) Date: Wed, 18 May 2011 01:13:39 -0400 Subject: Proxy module - upstream server recovery from inoperative mode Message-ID: Hi All, We are trying to use NGINX as a load balancing solution for our production servers. Our infrastructure contains few application server using SOAP XML over HTTP. NGNIX suppose to balance between servers. Please see config: user nginx; worker_processes 10; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 2048; } http { upstream CS { server 70.70.0.31:80 max_fails=1 fail_timeout=1s; server 70.70.0.41:80 max_fails=1 fail_timeout=1s; } server { listen 54321; location / { proxy_pass http://CS; proxy_read_timeout 2s; # proxy_connect_timeout 200ms; } } } NGINX does the work great until some of backend server fails to answer to NGINX in time and it send request to other server. Until this point everything is great and working. Now failed server should recover from inoperative mode to operetive mode after 1 second as I've defined fail_timeout to 1 second (Here might be my mistake because it may be recovers but right after it fails again) and it doesn't. I'm getting to the point where NGINX says that there is no operative upstream servers available because in some point load to the servers is so high that both of servers unable to answer in time. We are working on solving our servivce issue. However I think it is cruicial for load balancer be able moving failed upstream server to operative mode. May be I'm doing something wrong. Which log level will show the recovery? I will appreciate for any help! Regards, Seva Feldman Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198952,198952#msg-198952 From igor at sysoev.ru Wed May 18 10:49:21 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 18 May 2011 10:49:21 +0400 Subject: Rewrite rule for nginx from Apache In-Reply-To: References: <72a81ff3e80ed0b4b78cb81a348826cf@ruby-forum.com> <2507a2f6fd2c5e8a743f33ca869dfa82.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110518064921.GC45611@sysoev.ru> On Tue, May 17, 2011 at 06:51:33PM -0400, the_traveller wrote: > First of all thank you very much mr Igor This is a great help for me > but as i'm new to nginx so i'm little bit careful > but i have afew more things to ask about > > do i have to make any defination to these params > > SCRIPT_FILENAME > maindir "/maindir/" is from RewriteBase /maindir/ By default it is "/", for example, location /chat/ SCRIPT_FILENAME is FastCGI parameter which contains file system script name. > which is used as > fastcgi_param SCRIPT_FILENAME /path/to/script/pages.php; > AND > location /maindir/chat/ > > Or they just have to be written as they are?? -- Igor Sysoev From igor at sysoev.ru Wed May 18 11:34:01 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 18 May 2011 11:34:01 +0400 Subject: File AIO and multiple nginx instances In-Reply-To: References: Message-ID: <20110518073401.GG45611@sysoev.ru> On Wed, May 18, 2011 at 12:09:34AM -0400, arti wrote: > Hello. > > I need to run two nginx instances on one server (not two workers, but > two master processes with their own number of workers each). The problem > is that when nginx is compiled with aio support I can start only one > instance. When I try to start the second one, only master process starts > and these lines appear in error log: > > [emerg] 12789#0: io_setup() failed (1: Operation not permitted) > ... > [alert] 12715#0: worker process 12789 exited with fatal code 2 and can > not be respawn > ... > > This happens even if aio directive isn't used in configuration. > > My system is CentOS 5.5 with kernel 2.6.18-194.32.1.el5, I've tried > nginx 1.0.0 and nginx 1.0.2 > > So, is it expected behavior (I don't know nginx and/or aio internals), > or is it a bug in nginx or aio, and is there a way to start two nginx > instances, both with aio support? It's strange, but io_setup(2) man does not even mention EPERM: http://www.kernel.org/doc/man-pages/online/pages/man2/io_setup.2.html -- Igor Sysoev From pascal.nitsche at fansubcode.org Wed May 18 11:49:40 2011 From: pascal.nitsche at fansubcode.org (Pascal Nitsche) Date: Wed, 18 May 2011 09:49:40 +0200 Subject: ngx_http_secure_download report back to application? Message-ID: <4DD37A14.2050201@fansubcode.org> Hello, I'm thinking about writing an application, which should use nginx' secure download module to generate secure - expireing - links and limit the number of (successful) downloads. Since it only should count successful downloads it needs to know if the download was successful so it would be good to have nginx report to the application "Hey, I've got one more complete download". In the best case also "Download failed, but I transfered N bytes" for statistical reasons inside the application (This could be used to track traffic usage by file and stop generating links if a traffic limit has passed). The download server and the application server could - but haven't to - run on different machines. Now my question is: Is something like this possible? Can I send a response to an application in - let's say XML or JSON? And if yes: How? Thanks in advance, Pascal Nitsche From wubingzheng at 163.com Wed May 18 13:15:00 2011 From: wubingzheng at 163.com (=?UTF-8?Q?Wu=C2=A0Bingzheng?=) Date: Wed, 18 May 2011 17:15:00 +0800 (CST) Subject: 2 questions on send_timeout (maybe bugs) Message-ID: <10a6803e.1907c.130026300cb.Coremail.wubingzheng@163.com> hi all, I meet 2 question when using nginx 1.0.0. Question1. what happens if the downstream connection breaks, before all data sent to the client? 1. get client's request 2. set handler: r->read_event_handle=ngx_http_block_reading 3. send data to client, and blocked ( write_filter.c:c->send_chain() returns non-NULL or non-error), and go back to epoll_wait 4. HERE, the downstream breaks 5. epoll detect the breaking, so epoll_wait() continues in ngx_epoll_process_events(), where the revents==EPOLL_IN | EPOLL_ERR | EPOLL_HUP. So we call rev->handler(), which calls r->read_event_handle, which dose nothing. AS A RESULT, the downstream breaking was not detected by nginx !!! 6. Then, we have to wait for send_timeout... This situation dosenot occur everytime. If the downstream breaks, when nginx is sending data, the breaking will be detected. But I can make this happen all the time, when: 1. the client and server are far away from each other (e.g. not in a local net) 2. using memc module Question2. I set 'send_timeout' as 20s, but nginx timeouts in 40s actually. 1. in src/http/ngx_http_upstream.c[line2448]:ngx_http_upstream_process_non_buffered_request(), a timer is added; 2. after that timer timeout, in src/http/ngx_http_request.c[line2179]:ngx_http_set_write_handler(), another timer is added again. so the send_timeout is doubled. Thanks Wu From nginx-forum at nginx.us Wed May 18 17:03:40 2011 From: nginx-forum at nginx.us (Ensiferous) Date: Wed, 18 May 2011 09:03:40 -0400 Subject: ngx_http_secure_download report back to application? In-Reply-To: <4DD37A14.2050201@fansubcode.org> References: <4DD37A14.2050201@fansubcode.org> Message-ID: <06d9bc75fdbcf1ed50b63659bdf8cc26.NginxMailingListEnglish@forum.nginx.org> Hi, You can do this with http://wiki.nginx.org/HttpCoreModule#post_action and http://wiki.nginx.org/HttpCoreModule#.24request_completion Sincerely, Martin Fjordvald Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198967,199037#msg-199037 From mdounin at mdounin.ru Wed May 18 17:35:07 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 18 May 2011 17:35:07 +0400 Subject: 2 questions on send_timeout (maybe bugs) In-Reply-To: <10a6803e.1907c.130026300cb.Coremail.wubingzheng@163.com> References: <10a6803e.1907c.130026300cb.Coremail.wubingzheng@163.com> Message-ID: <20110518133507.GV42265@mdounin.ru> Hello! On Wed, May 18, 2011 at 05:15:00PM +0800, Wu Bingzheng wrote: > hi all, > > > I meet 2 question when using nginx 1.0.0. > > > Question1. > > what happens if the downstream connection breaks, before all > data sent to the client? > > 1. get client's request > 2. set handler: r->read_event_handle=ngx_http_block_reading > 3. send data to client, and blocked ( > write_filter.c:c->send_chain() returns non-NULL or non-error), > and go back to epoll_wait > 4. HERE, the downstream breaks > 5. epoll detect the breaking, so epoll_wait() continues in > ngx_epoll_process_events(), where the revents==EPOLL_IN | > EPOLL_ERR | EPOLL_HUP. So we call rev->handler(), which calls > r->read_event_handle, which dose nothing. AS A RESULT, the > downstream breaking was not detected by nginx !!! Here write event handler will be called. While standard ngx_http_writer() is in use - it will call output filter chain and detect error. Else it's up to active handler to correctly handle this, e.g. standard upstream modules (proxy/fastcgi/...) may either terminate request immediately or wait for full upstream response depending on various settings (proxy_ignore_client_abort, proxy_cache/proxy_store enabled). > 6. Then, we have to wait for send_timeout... > > This situation dosenot occur everytime. If the downstream > breaks, when nginx is sending data, the breaking will be > detected. > But I can make this happen all the time, when: > 1. the client and server are far away from each other (e.g. not > in a local net) > 2. using memc module > > Question2. > > I set 'send_timeout' as 20s, but nginx timeouts in 40s actually. > > 1. in > src/http/ngx_http_upstream.c[line2448]:ngx_http_upstream_process_non_buffered_request(), > a timer is added; > 2. after that timer timeout, in > src/http/ngx_http_request.c[line2179]:ngx_http_set_write_handler(), > another timer is added again. > > so the send_timeout is doubled. Timeout is re-set on each send operation, and expected to be triggered when nothing happens during send_timeout. Maxim Dounin From pascal.nitsche at fansubcode.org Wed May 18 18:35:04 2011 From: pascal.nitsche at fansubcode.org (Pascal Nitsche) Date: Wed, 18 May 2011 16:35:04 +0200 Subject: ngx_http_secure_download report back to application? In-Reply-To: <06d9bc75fdbcf1ed50b63659bdf8cc26.NginxMailingListEnglish@forum.nginx.org> References: <4DD37A14.2050201@fansubcode.org> <06d9bc75fdbcf1ed50b63659bdf8cc26.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4DD3D918.8070800@fansubcode.org> Hello Ensiferous, thanks for your answer I think this will do the trick. Is there also a possibility to get the transfered bytes inside the request? (This would be really nice but is just optional.) Thanks for your help again, Pascal Nitsche Am 18.05.2011 15:03, schrieb Ensiferous: > Hi, > > You can do this with http://wiki.nginx.org/HttpCoreModule#post_action > and http://wiki.nginx.org/HttpCoreModule#.24request_completion > > Sincerely, > Martin Fjordvald > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198967,199037#msg-199037 > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Wed May 18 20:11:33 2011 From: nginx-forum at nginx.us (myckeul) Date: Wed, 18 May 2011 12:11:33 -0400 Subject: Proxy_pass and slash witch nginx Message-ID: Hello, I set up a reverse proxy for a client with Nginx. I still have a problem when I click on a link but the name of the directory doesn't end with a slash. The proxy address is http://proxy.com and all requests are returned to http://mydomain.com Example: http://proxy.com/test/ and reference works well inside http://mydomain.com but remains on http://proxy.com/test/ If I remove the slash of the end I don't have http://proxy.com/test in the address bar but http://mydomain.com/test/ (with slash at the end because the other web server adds). In the http headers I see a 301 but it is not handled by nginx visibly: http://proxy.com/test GET /test HTTP/1.1 Host: proxy.com User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip, deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive Cookie: language1=en; language2=en HTTP/1.1 301 Moved Permanently Server: nginx/0.7.67 Date: Wed, 18 May 2011 07:15:57 GMT Content-Type: text/html; charset=iso-8859-1 Transfer-Encoding: chunked Connection: keep-alive Location: http://mydomain.com/test/ Age: 108 I thought to rewrite the rules but it might cause trouble. If anyone has an idea on the subject, I'm interested. Thank you Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198964,198964#msg-198964 From steven at deobald.ca Wed May 18 23:35:49 2011 From: steven at deobald.ca (Steven Deobald) Date: Wed, 18 May 2011 14:35:49 -0500 Subject: max_fails for 404s? Message-ID: Hey folks, We've got the following scenario occurring in production. The solution is non-obvious... to me, at least. [client] ==> [nginx] ==> [service S] * nginx fronting 2 application servers which provide a service S. (Primary and backup, both running Trinidad. Trinidad is a JRuby/Rails wrapper for Tomcat.) * hot-deploying a rails (jruby) app into Trinidad causes Trinidad to return a 404 to nginx * nginx returns the 404 to the application. In this particular case, the client is another service which expects service S to remain live during deployments So, nginx does provide an "http_404" case for the "proxy_next_upstream" directive. However, this would require the "max_fails" setting to pertain to 404s, which it doesn't... otherwise legitimate 404s produce an infinite loop. Is there something like "max_fails" for 404s? Is there another solution to this problem? Is it Trinidad's fault for returning 404s and not 503s? (I would say it is but I can't find a solution to that problem just yet.) Thanks! -steven -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Wed May 18 23:50:45 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Wed, 18 May 2011 23:50:45 +0400 Subject: Proxy_pass and slash witch nginx In-Reply-To: References: Message-ID: <20110518195045.GX42265@mdounin.ru> Hello! On Wed, May 18, 2011 at 12:11:33PM -0400, myckeul wrote: > Hello, > > I set up a reverse proxy for a client with Nginx. > > I still have a problem when I click on a link but the name of the > directory doesn't end with a slash. > > The proxy address is http://proxy.com and all requests are returned to > http://mydomain.com > > Example: http://proxy.com/test/ and reference works well inside > http://mydomain.com but remains on http://proxy.com/test/ > > If I remove the slash of the end I don't have http://proxy.com/test in > the address bar but http://mydomain.com/test/ (with slash at the end > because the other web server adds). > > In the http headers I see a 301 but it is not handled by nginx visibly: > > http://proxy.com/test > > > GET /test HTTP/1.1 > Host: proxy.com [...] > HTTP/1.1 301 Moved Permanently [...] > Location: http://mydomain.com/test/ > > Age: 108 > > I thought to rewrite the rules but it might cause trouble. > > If anyone has an idea on the subject, I'm interested. http://wiki.nginx.org/HttpProxyModule#proxy_redirect Maxim Dounin From antoine.bonavita at gmail.com Wed May 18 23:53:39 2011 From: antoine.bonavita at gmail.com (Antoine Bonavita) Date: Wed, 18 May 2011 21:53:39 +0200 Subject: max_fails for 404s? In-Reply-To: References: Message-ID: Hello, >From my understanding you don't even want to set max_fails. From the wiki (http://wiki.nginx.org/HttpUpstreamModule#server): "max_fails = NUMBER - number of unsuccessful attempts at communicating with the server within the time period (assigned by parameter fail_timeout) after which it is considered inoperative" While you hot-deploy server1 it will return 404. Because of "proxy_next_upstream http_404", nginx will try server2 (which is assumed to work). So, client sees response from server2. When you're done with hot-deploying on server1, it should start returning non-404 and you can safely hot-deploy server2. Of course, as you are asking, this might be the configuration you already have and it might not have this (expected) behavior. If you have proxy_next_upstream http_404 in your configuration and it's not working this way, you'll have to provide logs corresponding to the hot-deployment if you want people here to give you a hand. A. -- Take a break. Visit nginx-land: http://www.nginx-discovery.com On Wed, May 18, 2011 at 9:35 PM, Steven Deobald wrote: > Hey folks, > We've got the following scenario?occurring?in production. The solution is > non-obvious... to me, at least. > [client] ==> [nginx] ==> [service S] > * nginx fronting 2 application servers which provide a service S. (Primary > and backup, both running Trinidad. Trinidad is a JRuby/Rails wrapper for > Tomcat.) > * hot-deploying a rails (jruby) app into Trinidad causes Trinidad to return > a 404 to nginx > * nginx returns the 404 to the application. In this particular case, the > client is another service which expects service S to remain live during > deployments > So, nginx does provide an "http_404" case for the "proxy_next_upstream" > directive. However, this would require the "max_fails" setting to pertain to > 404s, which it doesn't... otherwise legitimate 404s produce an infinite > loop. > Is there something like "max_fails" for 404s? > Is there another solution to this problem? > Is it Trinidad's fault for returning 404s and not 503s? (I would say it is > but I can't find a solution to that problem just yet.) > Thanks! > -steven > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > > From mdounin at mdounin.ru Thu May 19 00:00:46 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 19 May 2011 00:00:46 +0400 Subject: max_fails for 404s? In-Reply-To: References: Message-ID: <20110518200046.GY42265@mdounin.ru> Hello! On Wed, May 18, 2011 at 02:35:49PM -0500, Steven Deobald wrote: > Hey folks, > > We've got the following scenario occurring in production. The solution is > non-obvious... to me, at least. > > [client] ==> [nginx] ==> [service S] > > * nginx fronting 2 application servers which provide a service S. (Primary > and backup, both running Trinidad. Trinidad is a JRuby/Rails wrapper for > Tomcat.) Do you mean "backup" as in "server ... backup;" in upstream definition? > * hot-deploying a rails (jruby) app into Trinidad causes Trinidad to return > a 404 to nginx > * nginx returns the 404 to the application. In this particular case, the > client is another service which expects service S to remain live during > deployments > > So, nginx does provide an "http_404" case for the "proxy_next_upstream" > directive. However, this would require the "max_fails" setting to pertain to > 404s, which it doesn't... otherwise legitimate 404s produce an infinite > loop. > > Is there something like "max_fails" for 404s? > Is there another solution to this problem? > Is it Trinidad's fault for returning 404s and not 503s? (I would say it is > but I can't find a solution to that problem just yet.) Parameter max_fails is to mark backends down, and you probably don't want to mark backends down just because of some real/legitimate 404's. On the other hand, using "server ... backup" indeed will cause infinite loop with "proxy_next_upstream http_404". It's a bug, it should only ask each backend once. Workaround is to don't use "server ... backup" but use either "weight=" instead (big one for real server, small one for backup one) or use error_page-based fallback instead. Maxim Dounin From nginx-forum at nginx.us Thu May 19 00:20:31 2011 From: nginx-forum at nginx.us (mankins) Date: Wed, 18 May 2011 16:20:31 -0400 Subject: proxy_cache 404 doesn't add headers Message-ID: Hi. In nginx 1.0.2 on Fedora, I'm using the proxy_cache in conjunction with add_header to add the following header with cache-status (MISS,EXPIRED, etc.) after the cache check: add_header X-Cache "$upstream_cache_status,$upstream_status,$upstream_addr"; This works as expected for http status codes 200, 301, 302, but fails to work for 404. I've verified that the cache is actually working for 404 requests (upstream sees no requests), but the extra add_header fails to get added. Any insight onto this behavior would be great. Thank you, Matt Mankins Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199145,199145#msg-199145 From jelledejong at powercraft.nl Thu May 19 00:28:16 2011 From: jelledejong at powercraft.nl (Jelle de Jong) Date: Wed, 18 May 2011 22:28:16 +0200 Subject: searching example config for my setup Message-ID: <4DD42BE0.7050705@powercraft.nl> I am searching for an example configuration file for nginx for the follow set-up: - firewall with prerouting port 80 and 443 to server-x running nginx - server-a running apache on port 80 (a.example.org) (192.168.24.60) - server-b running apache on port 80 (b.example.org) (192.168.24.61) - server-c running apache on port 80 (c.example.org) (192.168.24.62) - ... - all ip-based request should be return a not available error How can I make a name-based redirection to the different servers? And should I handle https on nginx or should apache handle it? I am running Debian 6.0.1. with nginx 0.7.67 Thanks in advance, Kind regards, Jelle de Jong -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 316 bytes Desc: OpenPGP digital signature URL: From steven at deobald.ca Thu May 19 01:04:09 2011 From: steven at deobald.ca (Steven Deobald) Date: Wed, 18 May 2011 16:04:09 -0500 Subject: max_fails for 404s? In-Reply-To: <20110518200046.GY42265@mdounin.ru> References: <20110518200046.GY42265@mdounin.ru> Message-ID: > Do you mean "backup" as in "server ... backup;" in upstream definition? I do. And thank you for the detailed reply -- this was exactly the information I was looking for! Cheers, -steven On Wed, May 18, 2011 at 3:00 PM, Maxim Dounin wrote: > Hello! > > On Wed, May 18, 2011 at 02:35:49PM -0500, Steven Deobald wrote: > > > Hey folks, > > > > We've got the following scenario occurring in production. The solution is > > non-obvious... to me, at least. > > > > [client] ==> [nginx] ==> [service S] > > > > * nginx fronting 2 application servers which provide a service S. > (Primary > > and backup, both running Trinidad. Trinidad is a JRuby/Rails wrapper for > > Tomcat.) > > Do you mean "backup" as in "server ... backup;" in upstream > definition? > > > * hot-deploying a rails (jruby) app into Trinidad causes Trinidad to > return > > a 404 to nginx > > * nginx returns the 404 to the application. In this particular case, the > > client is another service which expects service S to remain live during > > deployments > > > > So, nginx does provide an "http_404" case for the "proxy_next_upstream" > > directive. However, this would require the "max_fails" setting to pertain > to > > 404s, which it doesn't... otherwise legitimate 404s produce an infinite > > loop. > > > > Is there something like "max_fails" for 404s? > > Is there another solution to this problem? > > Is it Trinidad's fault for returning 404s and not 503s? (I would say it > is > > but I can't find a solution to that problem just yet.) > > Parameter max_fails is to mark backends down, and you probably > don't want to mark backends down just because of some > real/legitimate 404's. > > On the other hand, using "server ... backup" indeed will cause > infinite loop with "proxy_next_upstream http_404". It's a bug, it > should only ask each backend once. > > Workaround is to don't use "server ... backup" but use either > "weight=" instead (big one for real server, small one for backup > one) or use error_page-based fallback instead. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jelledejong at powercraft.nl Thu May 19 01:28:26 2011 From: jelledejong at powercraft.nl (Jelle de Jong) Date: Wed, 18 May 2011 23:28:26 +0200 Subject: searching example config for my setup In-Reply-To: <4DD42BE0.7050705@powercraft.nl> References: <4DD42BE0.7050705@powercraft.nl> Message-ID: <4DD439FA.2000705@powercraft.nl> On 18-05-11 22:28, Jelle de Jong wrote: > I am searching for an example configuration file for nginx for the > follow set-up: echo 'server { server_name a.example.org; location / { proxy_pass http://192.168.24.61/; } } server { server_name b.example.org; location / { proxy_pass http://192.168.24.62/; } } server { server_name c.example.org; location / { proxy_pass http://192.168.24.63/; } }' | tee /etc/nginx/conf.d/02example.conf Looking at several snippet I made the above config, it seems to partaly do what I want... Is this the correct way (efficient/secure)? Kind regards, Jelle de Jong -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 316 bytes Desc: OpenPGP digital signature URL: From ngw at nofeed.org Thu May 19 02:40:20 2011 From: ngw at nofeed.org (Nicholas Wieland) Date: Wed, 18 May 2011 15:40:20 -0700 Subject: Serving websites from S3 Message-ID: <3B6D17C2-1812-4A83-B0B2-016E788356A0@nofeed.org> Hi guys, I've tried to ask pretty much everywhere, but no solution until now. I'm quite sure I'm doing something wrong here, but to be honest I'm not able to catch it. I'm rewriting urls from test.foo.com to bar.foo.com.s3.amazonaws.com/test, and everything works like a charm. If I point the browser to test.foo.com/index.html nginx serves my static website exactly as I want. The problem I'm facing now is that I'm not able to have nginx serve my index.html by default, while retrieving test.foo.com/ I've tried both try_files and index so far, with no result. I've also tried to catch 404s and serve my index.html page (even though I guess this is a bad practice). This is what I have right now: https://gist.github.com/9a1ca5095392fb083f05 Can someone help me? I'm a bit out of ideas. What is really strange to me is that (real example) http://test.stylej.am/ answers with a 404, I really have no idea why try_files doesn't work... Maybe $url/index.html is not right and I should use another syntax? ngw -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Thu May 19 04:40:15 2011 From: nginx-forum at nginx.us (runesoerensen) Date: Wed, 18 May 2011 20:40:15 -0400 Subject: Multiple SSL enabled hosts causes nginx to reload slowly Message-ID: Hi, I've set up a ssl_certificate and ssl_certificate_key directives on the http level of my nginx configuration. The problem I'm facing is that starting/reloading nginx is getting slower and slower as more hosts (server directives) are added. The server has roughly 1000 SSL-enabled hosts that inherits the ssl certificate directives. I know nginx verifies the certificate when loading it, so I'm wondering if nginx checks the certificate each time an SSL enabled host inherits the shared certificate? If so, shouldn't it only check the certificate once? According to http://nginx.org/en/docs/http/configuring_https_servers.html it should cause all hosts to inherit a single memory footprint, but this doesn't seem to be the case. If this is a bug in nginx it may be an idea to completely disable certificate verification if possible? Any advice is highly appreciated. Best, Rune Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199166,199166#msg-199166 From wubingzheng at 163.com Thu May 19 06:39:43 2011 From: wubingzheng at 163.com (Wu Bingzheng) Date: Thu, 19 May 2011 10:39:43 +0800 (CST) Subject: 2 questions on send_timeout (maybe bugs) In-Reply-To: <20110518133507.GV42265@mdounin.ru> References: <20110518133507.GV42265@mdounin.ru> <10a6803e.1907c.130026300cb.Coremail.wubingzheng@163.com> Message-ID: <54e4f427.3d5f.130061f7663.Coremail.wubingzheng@163.com> Hi Maxim, Thanks for your answer. But I am still confused. At 2011-05-18 21:35:07?"Maxim Dounin" wrote: >Hello! > >On Wed, May 18, 2011 at 05:15:00PM +0800, Wu Bingzheng wrote: > >> hi all, >> >> >> I meet 2 question when using nginx 1.0.0. >> >> >> Question1. >> >> what happens if the downstream connection breaks, before all >> data sent to the client? >> >> 1. get client's request >> 2. set handler: r->read_event_handle=ngx_http_block_reading >> 3. send data to client, and blocked ( >> write_filter.c:c->send_chain() returns non-NULL or non-error), >> and go back to epoll_wait >> 4. HERE, the downstream breaks >> 5. epoll detect the breaking, so epoll_wait() continues in >> ngx_epoll_process_events(), where the revents==EPOLL_IN | >> EPOLL_ERR | EPOLL_HUP. So we call rev->handler(), which calls >> r->read_event_handle, which dose nothing. AS A RESULT, the >> downstream breaking was not detected by nginx !!! > >Here write event handler will be called. While standard >ngx_http_writer() is in use - it will call output filter chain and >detect error. Else it's up to active handler to correctly handle >this, e.g. standard upstream modules (proxy/fastcgi/...) may >either terminate request immediately or wait for full upstream >response depending on various settings (proxy_ignore_client_abort, >proxy_cache/proxy_store enabled). > You said the write handler will be called. But if a connection is break, revents returned by epoll_wait() is 'EPOLL_IN | EPOLL_ERR | EPOLL_HUP', and no EPOLL_OUT in revents. So I think the write-handler will NOT be called. The FACT is, in my server, there are many many access logs whose time-taken are 40.001s. (send_timeout is 20s, and this is a music online server, so many people re-choose a song before the current song finishs, which means the downstream breaks before nginx sends all data). I add 2 debug log in ngx_epoll_process_events(), and copy part of the debug log here. In this log, fd8 is downstream and fd9 is upstream. Only the downstream is what we will focus on (so ignore the fd9 please). You can see that, in line 4, nginx write 496B to downstream, and the return value is non-NULL(line 5), which means the downstream is delayed. In line 20, epoll_wait() returns with revents=25, which means the fd8(downstream) is *break*. But only a read-handler is called in line 21, and NO write-handler is called. So, nginx doesnot detect the break of downstream, and waits for send_timeout, and *wakes* in line 32 and 35. 0 ...... 1 2011/05/19 10:00:07 [debug] 26851#0: *1 write new buf t:0 f:0 0000000000000000, pos 00000000005AFB70, size: 4096 file: 0, size: 0 2 2011/05/19 10:00:07 [debug] 26851#0: *1 http write filter: l:0 f:1 s:4096 3 2011/05/19 10:00:07 [debug] 26851#0: *1 http write filter limit 0 4 2011/05/19 10:00:07 [debug] 26851#0: *1 writev: 496 5 2011/05/19 10:00:07 [debug] 26851#0: *1 http write filter 00000000005D91C0 6 2011/05/19 10:00:07 [debug] 26851#0: *1 copy filter: -2 "/data/music/885720/??~J???.mp3?xcode=efb9e826d9161812ab9483faf71dddbb" 7 2011/05/19 10:00:07 [debug] 26851#0: *1 event timer add: 8: 20000:1305770427453 8 2011/05/19 10:00:07 [debug] 26851#0: *1 event timer del: 9: 1305770467453 9 2011/05/19 10:00:07 [debug] 26851#0: *1 epoll call wriet handler. fd: 9, revnets:5 10 2011/05/19 10:00:07 [debug] 26851#0: *1 http upstream request: "/data/music/885720/??~J???.mp3?xcode=efb9e826d9161812ab9483faf71dddbb" 11 2011/05/19 10:00:07 [debug] 26851#0: *1 http upstream dummy handler 12 2011/05/19 10:00:07 [debug] 26851#0: *1 epoll_wait: fd 9, revnets:5 13 2011/05/19 10:00:07 [debug] 26851#0: *1 epoll call read handler. fd: 9, revnets:5 14 2011/05/19 10:00:07 [debug] 26851#0: *1 http upstream request: "/data/music/885720/??~J???.mp3?xcode=efb9e826d9161812ab9483faf71dddbb" 15 2011/05/19 10:00:07 [debug] 26851#0: *1 http upstream process non buffered upstream 16 2011/05/19 10:00:07 [debug] 26851#0: *1 event timer: 8, old: 1305770427453, new: 1305770427453 17 2011/05/19 10:00:07 [debug] 26851#0: *1 epoll call wriet handler. fd: 9, revnets:5 18 2011/05/19 10:00:07 [debug] 26851#0: *1 http upstream request: "/data/music/885720/??~J???.mp3?xcode=efb9e826d9161812ab9483faf71dddbb" 19 2011/05/19 10:00:07 [debug] 26851#0: *1 http upstream dummy handler 20 2011/05/19 10:00:07 [debug] 26851#0: *1 epoll_wait: fd 8, revnets:25 21 2011/05/19 10:00:07 [debug] 26851#0: *1 epoll call read handler. fd: 8, revnets:25 22 2011/05/19 10:00:07 [debug] 26851#0: *1 http run request: "/data/music/885720/??~J???.mp3?xcode=efb9e826d9161812ab9483faf71dddbb" 23 2011/05/19 10:00:07 [debug] 26851#0: *1 http reading blocked 24 2011/05/19 10:00:07 [debug] 26851#0: *1 epoll_wait: fd 9, revnets:5 25 2011/05/19 10:00:07 [debug] 26851#0: *1 epoll call read handler. fd: 9, revnets:5 26 2011/05/19 10:00:07 [debug] 26851#0: *1 http upstream request: "/data/music/885720/??~J???.mp3?xcode=efb9e826d9161812ab9483faf71dddbb" 27 2011/05/19 10:00:07 [debug] 26851#0: *1 http upstream process non buffered upstream 28 2011/05/19 10:00:07 [debug] 26851#0: *1 event timer: 8, old: 1305770427453, new: 1305770427654 29 2011/05/19 10:00:07 [debug] 26851#0: *1 epoll call wriet handler. fd: 9, revnets:5 30 2011/05/19 10:00:07 [debug] 26851#0: *1 http upstream request: "/data/music/885720/??~J???.mp3?xcode=efb9e826d9161812ab9483faf71dddbb" 31 2011/05/19 10:00:07 [debug] 26851#0: *1 http upstream dummy handler 32 2011/05/19 10:00:27 [debug] 26851#0: *1 event timer del: 8: 1305770427453 33 2011/05/19 10:00:27 [debug] 26851#0: *1 http run request: "/data/music/885720/??~J???.mp3?xcode=efb9e826d9161812ab9483faf71dddbb" 34 2011/05/19 10:00:27 [debug] 26851#0: *1 http upstream process non buffered downstream 35 2011/05/19 10:00:27 [info] 26851#0: *1 client timed out (110: Connection timed out) while sending to client, client: 61.135.169.175, server: z iyouziyuan.baidu.com, request: "GET /data/music/885720/%E4%BB%8A%E5%A4%A9.mp3?xcode=efb9e826d9161812ab9483faf71dddbb HTTP/1.0", upstream: "mem cached://172.18.254.50:11200" 36 2011/05/19 10:00:27 [debug] 26851#0: *1 finalize http upstream request: 0 37 2011/05/19 10:00:27 [debug] 26851#0: *1 finalize http memcached request >> 6. Then, we have to wait for send_timeout... >> >> This situation dosenot occur everytime. If the downstream >> breaks, when nginx is sending data, the breaking will be >> detected. >> But I can make this happen all the time, when: >> 1. the client and server are far away from each other (e.g. not >> in a local net) >> 2. using memc module >> >> Question2. >> >> I set 'send_timeout' as 20s, but nginx timeouts in 40s actually. >> >> 1. in >> src/http/ngx_http_upstream.c[line2448]:ngx_http_upstream_process_non_buffered_request(), >> a timer is added; >> 2. after that timer timeout, in >> src/http/ngx_http_request.c[line2179]:ngx_http_set_write_handler(), >> another timer is added again. >> >> so the send_timeout is doubled. > >Timeout is re-set on each send operation, and expected to be >triggered when nothing happens during send_timeout. So, you think that, I set 'send_timeout' as 20s, but nginx actually timeout in 40s is right and expected? > >Maxim Dounin > >_______________________________________________ >nginx mailing list >nginx at nginx.org >http://nginx.org/mailman/listinfo/nginx Thanks again for you responding. Best Regards, Wu From nginx-forum at nginx.us Thu May 19 06:52:39 2011 From: nginx-forum at nginx.us (ltss) Date: Wed, 18 May 2011 22:52:39 -0400 Subject: Rewrite rule for nginx from Apache In-Reply-To: References: Message-ID: Hello i am new to nginx and i need some help to convert my .htaccess, i have tried some shit but that not work ... Options FollowSymLinks RewriteEngine On RewriteRule ^(.*)\.php/img/(.*)$ img/$2 [C] RewriteRule ^/img/(.*)$ img/$2 [QSA,L] RewriteCond %{REQUEST_FILENAME} !^scriptsFtp.*$ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [QSA,L] Thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,23868,199175#msg-199175 From justin at specialbusservice.com Thu May 19 13:16:34 2011 From: justin at specialbusservice.com (Justin Cormack) Date: Thu, 19 May 2011 10:16:34 +0100 Subject: Serving websites from S3 In-Reply-To: <3B6D17C2-1812-4A83-B0B2-016E788356A0@nofeed.org> References: <3B6D17C2-1812-4A83-B0B2-016E788356A0@nofeed.org> Message-ID: <1305796594.3761.6.camel@mackerel> On Wed, 2011-05-18 at 15:40 -0700, Nicholas Wieland wrote: > Hi guys, I've tried to ask pretty much everywhere, but no solution > until now. I'm quite sure I'm doing something wrong here, but to be > honest I'm not able to catch it. > > > I'm rewriting urls from test.foo.com to > bar.foo.com.s3.amazonaws.com/test, and everything works like a charm. > If I point the browser to test.foo.com/index.html nginx serves my > static website exactly as I want. The problem I'm facing now is that > I'm not able to have nginx serve my index.html by default, while > retrieving test.foo.com/ > > > I've tried both try_files and index so far, with no result. I've also > tried to catch 404s and serve my index.html page (even though I guess > this is a bad practice). > > > This is what I have right > now: https://gist.github.com/9a1ca5095392fb083f05 > > > Can someone help me? I'm a bit out of ideas. > > > What is really strange to me is that (real example) > http://test.stylej.am/ answers with a 404, I really have no idea why > try_files doesn't work... Maybe $url/index.html is not right and I > should use another syntax? You know that Amazon added support for index files to S3? http://aws.typepad.com/aws/2011/02/host-your-static-website-on-amazon-s3.html Try_files does not work because it looks for acrual files on your file system, and thats not where S3 is! You can use two locations, one to match just / and one to match all other files. Justin From mdounin at mdounin.ru Thu May 19 14:42:39 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 19 May 2011 14:42:39 +0400 Subject: Multiple SSL enabled hosts causes nginx to reload slowly In-Reply-To: References: Message-ID: <20110519104239.GZ42265@mdounin.ru> Hello! On Wed, May 18, 2011 at 08:40:15PM -0400, runesoerensen wrote: > Hi, > > I've set up a ssl_certificate and ssl_certificate_key directives on the > http level of my nginx configuration. The problem I'm facing is that > starting/reloading nginx is getting slower and slower as more hosts > (server directives) are added. The server has roughly 1000 SSL-enabled > hosts that inherits the ssl certificate directives. > > I know nginx verifies the certificate when loading it, so I'm wondering > if nginx checks the certificate each time an SSL enabled host inherits > the shared certificate? If so, shouldn't it only check the certificate > once? According to > http://nginx.org/en/docs/http/configuring_https_servers.html it should > cause all hosts to inherit a single memory footprint, but this doesn't > seem to be the case. > > If this is a bug in nginx it may be an idea to completely disable > certificate verification if possible? > > Any advice is highly appreciated. Quick look suggests that time is taken mostly here in ngx_http_ssl_module.c: /* a temporary 512-bit RSA key is required for export versions of MSIE */ if (ngx_ssl_generate_rsa512_key(&conf->ssl) != NGX_OK) { return NGX_CONF_ERROR; } As export versions of MSIE are rare and hardly supported nowadays anyway, you may want to just nuke this code as a workaround. I'll take a look at this further as time permits. Maxim Dounin From mdounin at mdounin.ru Thu May 19 15:38:42 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 19 May 2011 15:38:42 +0400 Subject: 2 questions on send_timeout (maybe bugs) In-Reply-To: <54e4f427.3d5f.130061f7663.Coremail.wubingzheng@163.com> References: <20110518133507.GV42265@mdounin.ru> <10a6803e.1907c.130026300cb.Coremail.wubingzheng@163.com> <54e4f427.3d5f.130061f7663.Coremail.wubingzheng@163.com> Message-ID: <20110519113842.GA42265@mdounin.ru> Hello! On Thu, May 19, 2011 at 10:39:43AM +0800, Wu Bingzheng wrote: > Hi Maxim, > > Thanks for your answer. But I am still confused. > > > At 2011-05-18 21:35:07?"Maxim Dounin" wrote: > > >Hello! > > > >On Wed, May 18, 2011 at 05:15:00PM +0800, Wu Bingzheng wrote: > > > >> hi all, > >> > >> > >> I meet 2 question when using nginx 1.0.0. > >> > >> > >> Question1. > >> > >> what happens if the downstream connection breaks, before all > >> data sent to the client? > >> > >> 1. get client's request > >> 2. set handler: r->read_event_handle=ngx_http_block_reading > >> 3. send data to client, and blocked ( > >> write_filter.c:c->send_chain() returns non-NULL or non-error), > >> and go back to epoll_wait > >> 4. HERE, the downstream breaks > >> 5. epoll detect the breaking, so epoll_wait() continues in > >> ngx_epoll_process_events(), where the revents==EPOLL_IN | > >> EPOLL_ERR | EPOLL_HUP. So we call rev->handler(), which calls > >> r->read_event_handle, which dose nothing. AS A RESULT, the > >> downstream breaking was not detected by nginx !!! > > > >Here write event handler will be called. While standard > >ngx_http_writer() is in use - it will call output filter chain and > >detect error. Else it's up to active handler to correctly handle > >this, e.g. standard upstream modules (proxy/fastcgi/...) may > >either terminate request immediately or wait for full upstream > >response depending on various settings (proxy_ignore_client_abort, > >proxy_cache/proxy_store enabled). > > > > You said the write handler will be called. But if a connection > is break, revents returned by epoll_wait() is 'EPOLL_IN | > EPOLL_ERR | EPOLL_HUP', and no EPOLL_OUT in revents. So I think > the write-handler will NOT be called. Ah, ok, it looks like I was wrong here. Write handler will be only called if there are no EPOLLIN flag in revents, and this is probably wrong assuming EPOLLHUP follows the same semantics as POLLHUP[1], i.e. POLLHUP ... This event and POLLOUT are mutually-exclusive; a stream can never be writable if a hangup has occurred. ... Could you please provide detailed instructions to reproduce the problem, preferably with standard modules involved? [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html > The FACT is, in my server, there are many many access logs whose > time-taken are 40.001s. (send_timeout is 20s, and this is a > music online server, so many people re-choose a song before the > current song finishs, which means the downstream breaks before > nginx sends all data). > > I add 2 debug log in ngx_epoll_process_events(), and copy part > of the debug log here. Just a side note: mostly same information may be seen at global level debug log. [...] > >> I set 'send_timeout' as 20s, but nginx timeouts in 40s actually. > >> > >> 1. in > >> src/http/ngx_http_upstream.c[line2448]:ngx_http_upstream_process_non_buffered_request(), > >> a timer is added; > >> 2. after that timer timeout, in > >> src/http/ngx_http_request.c[line2179]:ngx_http_set_write_handler(), > >> another timer is added again. > >> > >> so the send_timeout is doubled. > > > >Timeout is re-set on each send operation, and expected to be > >triggered when nothing happens during send_timeout. > > So, you think that, I set 'send_timeout' as 20s, but nginx > actually timeout in 40s is right and expected? It should timeout in 20s after last send. Whether request time of 40s is wrong or not depends on many factors, but the code you pointed out looks fine. Note also that in debug log you provided nginx correctly times out after 20s from last send. Maxim Dounin From jelledejong at powercraft.nl Thu May 19 16:29:41 2011 From: jelledejong at powercraft.nl (Jelle de Jong) Date: Thu, 19 May 2011 14:29:41 +0200 Subject: searching example config for my setup In-Reply-To: <4DD439FA.2000705@powercraft.nl> References: <4DD42BE0.7050705@powercraft.nl> <4DD439FA.2000705@powercraft.nl> Message-ID: <4DD50D35.5070801@powercraft.nl> On 18-05-11 23:28, Jelle de Jong wrote: > On 18-05-11 22:28, Jelle de Jong wrote: >> I am searching for an example configuration file for nginx for the >> follow set-up: > Looking at several snippet I made the above config, it seems to partaly > do what I want... Is this the correct way (efficient/secure)? server { listen 80; server_name a.powercraft.nl; access_log /var/log/nginx/a.powercraft.nl.access.log; location / { proxy_set_header Host $host; proxy_pass http://192.168.24.63/; } } server { listen 80; server_name b.powercraft.nl; access_log /var/log/nginx/c.powercraft.nl.access.log; location / { proxy_set_header Host $host; proxy_pass http://192.168.24.63/; } } server { listen 80; listen 443; server_name c.powercraft.nl; access_log /var/log/nginx/c.powercraft.nl.access.log; location / { proxy_set_header Host $host; proxy_pass http://192.168.24.64/; } } I did some more research and found: http://wiki.nginx.org/HttpProxyModule http://wiki.nginx.org/VirtualHostExample I came up with the above set-up that partly fills my need :) Is it possbible to for http://192.168.24.63/ to see the IP-address of the original browser requesting the http data? Now only the IP of the nginx system is logged? (I know this is because of the proxy so I am wondering if this is something that can be fixed?) Is the configuration correct? Can it be improved? Hints & tips? Kind regards, Jelle de Jong -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 316 bytes Desc: OpenPGP digital signature URL: From antoine.bonavita at gmail.com Thu May 19 16:39:36 2011 From: antoine.bonavita at gmail.com (Antoine Bonavita) Date: Thu, 19 May 2011 14:39:36 +0200 Subject: searching example config for my setup In-Reply-To: <4DD50D35.5070801@powercraft.nl> References: <4DD42BE0.7050705@powercraft.nl> <4DD439FA.2000705@powercraft.nl> <4DD50D35.5070801@powercraft.nl> Message-ID: Hi, Did you try "proxy_set_header X-Real-IP $remote_addr;" ? A. -- Take a break. Visit nginx-land: http://www.nginx-discovery.com ;) On Thu, May 19, 2011 at 2:29 PM, Jelle de Jong wrote: > On 18-05-11 23:28, Jelle de Jong wrote: >> On 18-05-11 22:28, Jelle de Jong wrote: >>> I am searching for an example configuration file for nginx for the >>> follow set-up: >> Looking at several snippet I made the above config, it seems to partaly >> do what I want... Is this the correct way (efficient/secure)? > > server { > ? ?listen ? ? ?80; > ? ?server_name a.powercraft.nl; > ? ?access_log ?/var/log/nginx/a.powercraft.nl.access.log; > ? ?location / { > ? ? ? ?proxy_set_header ? ?Host $host; > ? ? ? ?proxy_pass ? ? ? ? ?http://192.168.24.63/; > ? ?} > } > > server { > ? ?listen ? ? ?80; > ? ?server_name b.powercraft.nl; > ? ?access_log ?/var/log/nginx/c.powercraft.nl.access.log; > ? ?location / { > ? ? ? ?proxy_set_header ? ?Host $host; > ? ? ? ?proxy_pass ? ? ? ? ?http://192.168.24.63/; > ? ?} > } > > server { > ? ?listen ? ? ?80; > ? ?listen ? ? ?443; > ? ?server_name c.powercraft.nl; > ? ?access_log ?/var/log/nginx/c.powercraft.nl.access.log; > ? ?location / { > ? ? ? ?proxy_set_header ? ?Host $host; > ? ? ? ?proxy_pass ? ? ? ? ?http://192.168.24.64/; > ? ?} > } > > I did some more research and found: > http://wiki.nginx.org/HttpProxyModule > http://wiki.nginx.org/VirtualHostExample > > I came up with the above set-up that partly fills my need :) > > Is it possbible to for http://192.168.24.63/ to see the IP-address of > the original browser requesting the http data? Now only the IP of the > nginx system is logged? (I know this is because of the proxy so I am > wondering if this is something that can be fixed?) > > Is the configuration correct? Can it be improved? Hints & tips? > > Kind regards, > > Jelle de Jong > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > > From nginx-forum at nginx.us Thu May 19 17:20:55 2011 From: nginx-forum at nginx.us (TECK) Date: Thu, 19 May 2011 09:20:55 -0400 Subject: Rewrite or internal redirection cycle? Message-ID: <0843318a97adce238d8a671167f03ead.NginxMailingListEnglish@forum.nginx.org> Hi, I'm having a bit of an issue with the rewrite scheme: server { ... location / { try_files $uri $uri/ @data; } location @data { rewrite ^ /data.php$is_args; internal; } ... } When I access this request: http://domain.com/information/feedback/?order=desc&sort=date I get an internal redirection cycle: *1 rewrite or internal redirection cycle while processing "/data.php?", client: IP, server: domain.com, request: "GET /information/feedback/?order=desc&sort=date HTTP/1.1", host: "domain.com", referrer: "http://domain.com/information/feedback/" However, if I access this request: http://domain.com/information/feedback/400028-some-information.html Everything works properly. What do you recommend to do, in order to troubleshoot the issue? My goal is to actually log what goes wrong with the php code, when the redirection cycle is encountered. Thanks for your help. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199260,199260#msg-199260 From malayter at gmail.com Thu May 19 17:24:12 2011 From: malayter at gmail.com (Ryan Malayter) Date: Thu, 19 May 2011 08:24:12 -0500 Subject: Virtualization In-Reply-To: References: Message-ID: On Fri, May 6, 2011 at 6:01 AM, Jonathan Leibiusky wrote: > Hey! > I am trying to virtualize nginx in my own private cloud. Is there any > special consideration regard configuration that I have to consider? > Anyone did something similar? Regard throughput, anyone with some > numbers to share? > We run nginx on single-core VMs both internally and in our hosted environment. Performance is excellent. WE allocate just 1-2 GB RAM per vm. The stack is: nginx 0.7.67->Ubuntu 10.04.2->Vmware ESX 4.1->Dell 2950III (Xeon 5300 series). I recall seeing >8000 requests/sec using apache bench for a static file 50K. And something like 5000 requests/sec for the same file served through nginx being proxy_passed to an IIS backend (without nginx proxy_cache). This is on a local LAN. In our production internet-facing environment, which uses only proxy_pass and proxy_cache in front of a Tomcat cluster, we routinely see peaks 1000+ requests/sec through any single nginx VM. About 70% of these requests are for static files that are usually hits in proxy_cache, the rest are dynamic pages from the Tomcat servers. In short, it just works. The only nginx tuning we really had to do was adjusting proxy_buffers upwards, adding more workers, and setting more connections per worker. We use 10 worker processes per core to get around the lack of AIO on Linux. As with all performance numbers, YMMV. There are*no* magic solutions, and no substitutes for doing your own load testing on your own code and hardware. We spent about 6 man-weeks building our load tests with NeoLoad, and now we can re-run whenever we have a new code release or are testing different infrastructure pieces. -- RPM From jelledejong at powercraft.nl Thu May 19 17:46:26 2011 From: jelledejong at powercraft.nl (Jelle de Jong) Date: Thu, 19 May 2011 15:46:26 +0200 Subject: searching example config for my setup In-Reply-To: References: <4DD42BE0.7050705@powercraft.nl> <4DD439FA.2000705@powercraft.nl> <4DD50D35.5070801@powercraft.nl> Message-ID: <4DD51F32.4010702@powercraft.nl> Dear Antoine, Thank you for taking the time to help. On 19-05-11 14:39, Antoine Bonavita wrote: > Did you try "proxy_set_header X-Real-IP $remote_addr;" ? I did, but it sill shows the IP-addr of the nginx server.... server { listen 80; server_name sandbox01.powercraft.nl; access_log /var/log/nginx/sandbox01.powercraft.nl.access.log; location / { proxy_pass http://192.168.24.63/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; } } # tail -n 1 /var/log/nginx/sandbox01.powercraft.nl.access.log; 109.32.215.197 - - [19/May/2011:15:42:41 +0200] "GET /themes/garland/print.css?1 HTTP/1.1" 304 0 "http://sandbox01.powercraft.nl/admin/settings" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110303 Ubuntu/10.04 (lucid) Firefox/3.6.15" # tail -n 1 /var/log/apache2/sandbox01.powercraft.nl/access-default.log 192.168.24.62 - - [19/May/2011:15:42:41 +0200] "GET /themes/garland/print.css?1 HTTP/1.0" 304 173 "http://sandbox01.powercraft.nl/admin/settings" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110303 Ubuntu/10.04 (lucid) Firefox/3.6.15" # 192.168.24.62 is the IP of the nginx server Any ideas? Tips? Kind regards, Jelle de Jong -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 316 bytes Desc: OpenPGP digital signature URL: From nginx-forum at nginx.us Thu May 19 17:59:37 2011 From: nginx-forum at nginx.us (klausi) Date: Thu, 19 May 2011 09:59:37 -0400 Subject: Disabling basic_auth with rewrites Message-ID: <6a08a5933318a87afa453d03b955c65b.NginxMailingListEnglish@forum.nginx.org> Hi, I would like to generally protect my site but allow one certain path. However, I need rewrites to forward the requested path to a PHP file. Unfortunately the following does not work: location ~ ^/feeds/importer/.* { auth_basic off; rewrite ^/(.*)$ /index.php?q=$1; } location ~ \.php$ { auth_basic "protected"; auth_basic_user_file /etc/nginx/htpasswd/protected; fastcgi_split_path_info ^(.+\.php)(/.+)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors on; fastcgi_pass $socket; # workaround as fastcgi_param cannot be used inside if statements set $https off; if ($scheme = https) { set $https on; } fastcgi_param HTTPS $https; fastcgi_read_timeout 6000; } location ~ ^/(.*) { auth_basic "protected"; auth_basic_user_file /etc/nginx/htpasswd/protected; try_files $uri /index.php?q=$1&$args; } Any ideas how to unprotect the first location? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199278,199278#msg-199278 From mdounin at mdounin.ru Thu May 19 18:09:50 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 19 May 2011 18:09:50 +0400 Subject: Disabling basic_auth with rewrites In-Reply-To: <6a08a5933318a87afa453d03b955c65b.NginxMailingListEnglish@forum.nginx.org> References: <6a08a5933318a87afa453d03b955c65b.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110519140950.GB42265@mdounin.ru> Hello! On Thu, May 19, 2011 at 09:59:37AM -0400, klausi wrote: > Hi, > > I would like to generally protect my site but allow one certain path. > However, I need rewrites to forward the requested path to a PHP file. > Unfortunately the following does not work: > > location ~ ^/feeds/importer/.* { > auth_basic off; > rewrite ^/(.*)$ /index.php?q=$1; > } > > location ~ \.php$ { > auth_basic "protected"; > auth_basic_user_file /etc/nginx/htpasswd/protected; > fastcgi_split_path_info ^(.+\.php)(/.+)$; > include fastcgi_params; > fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; > fastcgi_intercept_errors on; > fastcgi_pass $socket; > # workaround as fastcgi_param cannot be used inside if statements > set $https off; > if ($scheme = https) { > set $https on; > } > fastcgi_param HTTPS $https; > fastcgi_read_timeout 6000; > } > > location ~ ^/(.*) { > auth_basic "protected"; > auth_basic_user_file /etc/nginx/htpasswd/protected; > try_files $uri /index.php?q=$1&$args; > } > > Any ideas how to unprotect the first location? location / { auth_basic "protected"; auth_basic_user_file /etc/nginx/htpasswd/protected; ... location ~ \.php$ { fastcgi_pass ... ... } } location /feeds/importer/ { ... location ~ \.php$ { fastcgi_pass ... ... } } Maxim Dounin From antoine.bonavita at gmail.com Thu May 19 19:35:17 2011 From: antoine.bonavita at gmail.com (Antoine Bonavita) Date: Thu, 19 May 2011 17:35:17 +0200 Subject: searching example config for my setup In-Reply-To: <4DD51F32.4010702@powercraft.nl> References: <4DD42BE0.7050705@powercraft.nl> <4DD439FA.2000705@powercraft.nl> <4DD50D35.5070801@powercraft.nl> <4DD51F32.4010702@powercraft.nl> Message-ID: Hello, On Thu, May 19, 2011 at 3:46 PM, Jelle de Jong wrote: > Dear Antoine, > > Thank you for taking the time to help. > > On 19-05-11 14:39, Antoine Bonavita wrote: >> Did you try "proxy_set_header ?X-Real-IP ?$remote_addr;" ? > > I did, but it sill shows the IP-addr of the nginx server.... > > server { > ? ?listen ? ? ?80; > ? ?server_name sandbox01.powercraft.nl; > ? ?access_log ?/var/log/nginx/sandbox01.powercraft.nl.access.log; > ? ?location / { > ? ? ? ?proxy_pass ? ? ? ? ?http://192.168.24.63/; > ? ? ? ?proxy_set_header ? ?X-Real-IP ?$remote_addr; > ? ? ? ?proxy_set_header ? ?Host $host; > ? ?} > } > > # tail -n 1 /var/log/nginx/sandbox01.powercraft.nl.access.log; > 109.32.215.197 - - [19/May/2011:15:42:41 +0200] "GET > /themes/garland/print.css?1 HTTP/1.1" 304 0 > "http://sandbox01.powercraft.nl/admin/settings" "Mozilla/5.0 (X11; U; > Linux i686; en-US; rv:1.9.2.15) Gecko/20110303 Ubuntu/10.04 (lucid) > Firefox/3.6.15" > > # tail -n 1 /var/log/apache2/sandbox01.powercraft.nl/access-default.log > 192.168.24.62 - - [19/May/2011:15:42:41 +0200] "GET > /themes/garland/print.css?1 HTTP/1.0" 304 173 > "http://sandbox01.powercraft.nl/admin/settings" "Mozilla/5.0 (X11; U; > Linux i686; en-US; rv:1.9.2.15) Gecko/20110303 Ubuntu/10.04 (lucid) > Firefox/3.6.15" > > # 192.168.24.62 is the IP of the nginx server > > Any ideas? Tips? Sorry, I was assuming you were doing something else with the IP in the backend than logging. As far as I know the default logging for Apache uses variable %a which is always set to the other end of the socket (sandbox01.powercraft.nl in your example). Maybe you could configure your Apache logs to use %{X-Real-IP}i instead. There you should see what you expect in the Apache logs. Good luck with it, A. -- Take a break. Visit nginx-land: http://www.nginx-discovery.com ;) > > Kind regards, > > Jelle de Jong > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > > From nginx-forum at nginx.us Thu May 19 20:43:03 2011 From: nginx-forum at nginx.us (klausi) Date: Thu, 19 May 2011 12:43:03 -0400 Subject: Disabling basic_auth with rewrites In-Reply-To: <20110519140950.GB42265@mdounin.ru> References: <20110519140950.GB42265@mdounin.ru> Message-ID: <9739b40539caebc9cbb3d3c9dc3cdecd.NginxMailingListEnglish@forum.nginx.org> Maxim Dounin Wrote: ------------------------------------------------------- > > location / { > auth_basic "protected"; > auth_basic_user_file > /etc/nginx/htpasswd/protected; > ... > > location ~ \.php$ { > fastcgi_pass ... > ... > } > } > > location /feeds/importer/ { > ... > > location ~ \.php$ { > fastcgi_pass ... > ... > } > } Thanks for the quick reply, nested locations are nice, but they do not help in this special case. A request to /feeds/importer/* has to be rewritten to /index.php?q=feeds/importer/* and that should not be protected. Is unprotecting a path with a special query possible at all? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199278,199319#msg-199319 From mdounin at mdounin.ru Thu May 19 22:10:59 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 19 May 2011 22:10:59 +0400 Subject: Disabling basic_auth with rewrites In-Reply-To: <9739b40539caebc9cbb3d3c9dc3cdecd.NginxMailingListEnglish@forum.nginx.org> References: <20110519140950.GB42265@mdounin.ru> <9739b40539caebc9cbb3d3c9dc3cdecd.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110519181059.GD42265@mdounin.ru> Hello! On Thu, May 19, 2011 at 12:43:03PM -0400, klausi wrote: > Maxim Dounin Wrote: > ------------------------------------------------------- > > > > location / { > > auth_basic "protected"; > > auth_basic_user_file > > /etc/nginx/htpasswd/protected; > > ... > > > > location ~ \.php$ { > > fastcgi_pass ... > > ... > > } > > } > > > > location /feeds/importer/ { > > ... > > > > location ~ \.php$ { > > fastcgi_pass ... > > ... > > } > > } > > Thanks for the quick reply, nested locations are nice, but they do not > help in this special case. A request to /feeds/importer/* has to be > rewritten to /index.php?q=feeds/importer/* and that should not be > protected. Is unprotecting a path with a special query possible at all? Ah, sorry, I missed you actually want /feeds/importer/... to be fully handled by index.php. This makes configuration even simplier: location / { auth_basic ... ... location ~ \.php$ { fastcgi_pass ... ... } } location /feeds/importer/ { rewrite ^/(.*) /index.php?q=$1? break; fastcgi_pass ... ... } Note that the only goal of rewrite is to properly change url while correctly escaping new arguments and stripping old ones (note trailing '?'), as you probably don't want to allow unauthenticated users to supply arbitrary arguments to your index.php. Due to 'break' request doesn't leave the location in question after rewrite and processed there. Maxim Dounin From Richard.Kearsley at m247.com Thu May 19 22:15:42 2011 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Thu, 19 May 2011 18:15:42 +0000 Subject: lua: ngx.location.capture / limit proxy_cache individual file size Message-ID: Hi Is it possible to do a version of ngx.location.capture that only does a HEAD request rather than GET? I'm only interested in the headers returned, the body would make what I'm trying to do pointless :( Also if anyone has another method/idea of how to do this: I want to limit requests for files of size greater than 512000 bytes using proxy_cache and actively deny and not cache them I tried some stuff with 'if' but it's evaluated before the upstream-content-length is set :( -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor at sysoev.ru Thu May 19 23:16:56 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 19 May 2011 23:16:56 +0400 Subject: Disabling basic_auth with rewrites In-Reply-To: <20110519181059.GD42265@mdounin.ru> References: <20110519140950.GB42265@mdounin.ru> <9739b40539caebc9cbb3d3c9dc3cdecd.NginxMailingListEnglish@forum.nginx.org> <20110519181059.GD42265@mdounin.ru> Message-ID: <20110519191656.GA48682@sysoev.ru> On Thu, May 19, 2011 at 10:10:59PM +0400, Maxim Dounin wrote: > Hello! > > On Thu, May 19, 2011 at 12:43:03PM -0400, klausi wrote: > > > Maxim Dounin Wrote: > > ------------------------------------------------------- > > > > > > location / { > > > auth_basic "protected"; > > > auth_basic_user_file > > > /etc/nginx/htpasswd/protected; > > > ... > > > > > > location ~ \.php$ { > > > fastcgi_pass ... > > > ... > > > } > > > } > > > > > > location /feeds/importer/ { > > > ... > > > > > > location ~ \.php$ { > > > fastcgi_pass ... > > > ... > > > } > > > } > > > > Thanks for the quick reply, nested locations are nice, but they do not > > help in this special case. A request to /feeds/importer/* has to be > > rewritten to /index.php?q=feeds/importer/* and that should not be > > protected. Is unprotecting a path with a special query possible at all? > > Ah, sorry, I missed you actually want /feeds/importer/... to be > fully handled by index.php. This makes configuration even > simplier: > > location / { > auth_basic ... > ... > > location ~ \.php$ { > fastcgi_pass ... > ... > } > } > > location /feeds/importer/ { > rewrite ^/(.*) /index.php?q=$1? break; > > fastcgi_pass ... > ... > } > > Note that the only goal of rewrite is to properly change url while > correctly escaping new arguments and stripping old ones (note > trailing '?'), as you probably don't want to allow unauthenticated > users to supply arbitrary arguments to your index.php. Due to > 'break' request doesn't leave the location in question after > rewrite and processed there. My suggestion is to not use rewrite at all: location /feeds/importer/ { location ~ ^/(.*) { fastcgi_pass ... fastcgi_param SCRIPT_FILENAME /path/to/index.php; fastcgi_param QUERY_STRING q=$1; ... } -- Igor Sysoev From kyle.burton at gmail.com Thu May 19 23:34:55 2011 From: kyle.burton at gmail.com (Kyle R. Burton) Date: Thu, 19 May 2011 15:34:55 -0400 Subject: Question about using the load balancer Message-ID: Hello, I am using nginx as a load balancer in front of a tier of 4 web servers in a configuration very similar to: http://wiki.nginx.org/LoadBalanceExample I am doing rolling deployments of my application on the 4 web servers. During a deploy, I take 2 of my 4 boxes out of the load balancer by switching to an alternative nginx configuration and running 'nginx reload'. This has so far worked well. One thing I noticed is that when I do this, nginx seems to snap (break) any connections that were open at the time of the reload. Is there a configuration setting that I could use to allow these connections to complete gracefuly, but otherwise have all new connections be handled according to the updated configuration? Best Regards, Kyle Burton -- Twitter: @kyleburton Blog: http://asymmetrical-view.com/ Fun: http://snapclean.me/ From nginx-forum at nginx.us Thu May 19 23:51:11 2011 From: nginx-forum at nginx.us (omega8cc) Date: Thu, 19 May 2011 15:51:11 -0400 Subject: [NGINX] cache process manager consume a lot of CPU at reload and has to be restarted In-Reply-To: References: Message-ID: <5574016561bfd454ad04bd477e558e06.NginxMailingListEnglish@forum.nginx.org> Unfortunately, it still happens also for 1.0.2 release. I have seen it over 10 times on two different servers since upgrade to 1.0.0, then 1.0.1 and 1.0.2. Not sure how to debug this, as it is random issue, yet causes downtime until our auto-healing will kill all nginx processes and wait for load to stabilize to start nginx again. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,187322,199347#msg-199347 From ionathan at gmail.com Thu May 19 23:52:54 2011 From: ionathan at gmail.com (Jonathan Leibiusky) Date: Thu, 19 May 2011 16:52:54 -0300 Subject: loadbalancing Message-ID: Hi! It's been a while now that I am struggling with nginx round-robin load balancer. The problem that I am experiencing is that when a server goes down, the entire upstream is not balanced anymore. The next server will get double traffic. And if that one goes down, the next one will get 3 times the traffice, and so on. If I have something like this: server localhost max_fails=2 fail_timeout=60s; Does it mean that as soon as I get 2 fails within 60s it will mark the server as down without waiting the entire 60s? or is it going to wait 60s to mark the server down? If it waits 60s, how can I use round-robin and make sure that when a server goes down the rest will get traffic evenly? Thanks, Jonathan -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri May 20 00:34:34 2011 From: nginx-forum at nginx.us (nickn) Date: Thu, 19 May 2011 16:34:34 -0400 Subject: Randomly stopping large file downloads? Message-ID: Hi, 1.) What would cause nginx to randomly stop serving large file downloads? When I try to download a 800MB file it stops serving the file after between 10 and 30 MB. I've had to revert to lighttpd because of this. I checked the usual things: There wasn't anything in the error log, the system had plenty of memory (several hundred MB free) and the worker processes were all still there after the download dies. It doesn't matter what browser I use. Any idea what would cause this? 2.) BTW there's a bug in the forum.nginx.org forum where when you first get an account it prepopulates the login form with your email address rather than your user name. If you try to log in like that it won't let you in. You have to clear out what it prepopulated and enter your username. This is confusing. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199359,199359#msg-199359 From nginx-forum at nginx.us Fri May 20 00:37:38 2011 From: nginx-forum at nginx.us (myckeul) Date: Thu, 19 May 2011 16:37:38 -0400 Subject: Proxy_pass and slash witch nginx In-Reply-To: <20110518195045.GX42265@mdounin.ru> References: <20110518195045.GX42265@mdounin.ru> Message-ID: <0cbde934384bd99d3e3d381c2346af82.NginxMailingListEnglish@forum.nginx.org> Hello, Thanks for your response but they won't working. Here is my conf : nginx.conf : user www-data; worker_processes 1; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 1024; # multi_accept on; } http { include /etc/nginx/mime.types; access_log /var/log/nginx/access.log; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; tcp_nodelay on; gzip on; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } my vhost : server { listen [::]:80; server_name proxy.com *.proxy.com; access_log /var/log/nginx/proxy_.access.log; error_page 404 = /404.htm; location /404.htm { root /var/www; } location / { 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; if ($host ~* ^proxy\.com$) { proxy_pass http://mydomain.com; } if ($host ~* ^www\.proxy\.com$) { proxy_pass http://www.mydomain.com; } if ($host ~* ^subdomain\.proxy\.com$) { proxy_pass http://subdomain.mydomain.com; } proxy_redirect http://proxy.com/test http://proxy.com/test/; } } and my proxy.conf file : proxy_redirect off; proxy_intercept_errors on; 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; Thanks for your help Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198964,199196#msg-199196 From nginx-forum at nginx.us Fri May 20 00:54:48 2011 From: nginx-forum at nginx.us (omega8cc) Date: Thu, 19 May 2011 16:54:48 -0400 Subject: [NGINX] cache process manager consume a lot of CPU at reload and has to be restarted In-Reply-To: <5574016561bfd454ad04bd477e558e06.NginxMailingListEnglish@forum.nginx.org> References: <5574016561bfd454ad04bd477e558e06.NginxMailingListEnglish@forum.nginx.org> Message-ID: <202fe8694c21a8ab5aa0b60b79072cc2.NginxMailingListEnglish@forum.nginx.org> One possible reason could be some race condition when the server is still running in the reload state and it receives another reload command - this can be caused by provision in Aegir system for Drupal, as it reloads nginx sometimes two times during one action, like platform/site migration to make sure all vhosts are reloaded correctly. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,187322,199366#msg-199366 From jim at ohlste.in Fri May 20 01:01:01 2011 From: jim at ohlste.in (Jim Ohlstein) Date: Thu, 19 May 2011 17:01:01 -0400 Subject: Randomly stopping large file downloads? In-Reply-To: References: Message-ID: <4DD5850D.8010909@ohlste.in> On 5/19/11 4:34 PM, nickn wrote: > Hi, > 1.) What would cause nginx to randomly stop serving large file > downloads? When I try to download a 800MB file it stops serving the file > after between 10 and 30 MB. I've had to revert to lighttpd because of > this. > > I checked the usual things: There wasn't anything in the error log, the > system had plenty of memory (several hundred MB free) and the worker > processes were all still there after the download dies. It doesn't > matter what browser I use. > > Any idea what would cause this? > > > > 2.) BTW there's a bug in the forum.nginx.org forum where when you first > get an account it prepopulates the login form with your email address > rather than your user name. If you try to log in like that it won't let > you in. You have to clear out what it prepopulated and enter your > username. This is confusing. First, this is an issue with how your browser is "pre-populating" that field, not the forum software. See attached for what I see when I attempt to log in. This behavior is consistent in Firefox, Chrome, and Safari. Second, a "Username" is a user name and an email is an email. You should be able to distinguish between the two. Again, please see the attached login form. This hardly seems "confusing" to me. Again please see the attached. -- Jim Ohlstein -------------- next part -------------- A non-text attachment was scrubbed... Name: login.png Type: image/png Size: 3680 bytes Desc: not available URL: From nginx-forum at nginx.us Fri May 20 01:29:25 2011 From: nginx-forum at nginx.us (nickn) Date: Thu, 19 May 2011 17:29:25 -0400 Subject: Randomly stopping large file downloads? In-Reply-To: <4DD5850D.8010909@ohlste.in> References: <4DD5850D.8010909@ohlste.in> Message-ID: <3352d7c0910978a8a1b3a07e8afa2562.NginxMailingListEnglish@forum.nginx.org> An ideas why nginx would be cutting the downloads short? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199359,199377#msg-199377 From Richard.Kearsley at m247.com Fri May 20 01:59:16 2011 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Thu, 19 May 2011 21:59:16 +0000 Subject: lua location capture Message-ID: Hi The lua doc at https://github.com/chaoslawful/lua-nginx-module Says "Note that, by default, subrequests issued by ngx.location.capture inherit all the request headers of the current request." And goes on to say that it can be an unwanted feature In my project I actually take advantage of this feature, but for some reason the headers don't go through to the sub request All I get is: Uri:/checksize/100meg.zip Host : 127.0.0.1:12340 Connection : close Content-Length : 0 It should have a TON of headers and I've proven they are there in the main request Any ideas why they don't get through? Thanks as always Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at styleflare.com Fri May 20 02:10:04 2011 From: david at styleflare.com (David J.) Date: Thu, 19 May 2011 18:10:04 -0400 Subject: try_files Message-ID: <4DD5953C.7030202@styleflare.com> I have a uwsgi_app I was wondering why location / { root /myapp; index index.html index.wsgi; try_files $uri $uri/ @wsgi; } ; When I visit the domain.com returns a 403 (when I dont have an index.html file in the root directory); but if I do domain.com/index.wsgi The WSGI app is called. This all works. I am guessing I am doing something wrong. In my config I have location @wsgi { include uwsgi_params; uwsgi_pass unix:/tmp/uwsgi.sock } From agentzh at gmail.com Fri May 20 07:56:21 2011 From: agentzh at gmail.com (agentzh) Date: Fri, 20 May 2011 11:56:21 +0800 Subject: lua location capture In-Reply-To: References: Message-ID: On Fri, May 20, 2011 at 5:59 AM, Richard Kearsley wrote: > Hi > > The lua doc at https://github.com/chaoslawful/lua-nginx-module > > Says ?Note that, by default, subrequests issued by ngx.location.capture > inherit all the request headers of the current request.? > > And goes on to say that it can be an unwanted feature > > In my project I actually take advantage of this feature, but for some reason > the headers don?t go through to the sub request > Could you please paste your nginx.conf here? Also, information about your nginx's version and ngx_lua's version can also be helpful :) Best, -agentzh From wubingzheng at 163.com Fri May 20 07:58:20 2011 From: wubingzheng at 163.com (Wu Bingzheng) Date: Fri, 20 May 2011 11:58:20 +0800 (CST) Subject: 2 questions on send_timeout (maybe bugs) In-Reply-To: <20110519113842.GA42265@mdounin.ru> References: <20110519113842.GA42265@mdounin.ru> <20110518133507.GV42265@mdounin.ru> <10a6803e.1907c.130026300cb.Coremail.wubingzheng@163.com> <54e4f427.3d5f.130061f7663.Coremail.wubingzheng@163.com> Message-ID: <76e2ab59.13e9e.1300b8dcee7.Coremail.wubingzheng@163.com> Hi Maxim, 1. I am so sorry that I made a big mistake on question 1. Nginx didn't detect the downstream breaking, because I use "proxy_ignore_client_abort on;". So Nginx works correctlly. I am so sorry about it. 2. For question 2. You said that : >Note also that in debug log you provided nginx correctly times out >after 20s from last send. That's because I set the send_timeout as 10s. I am sorry that I did not make clear of that. You can reproduce the doubled timeout easy: [server] using nginx-1.0.0, without any addon module. in nginx.conf: server { listen 5821; proxy_buffering off; #must in non-buffering mode send_timeout 10; location / { proxy_pass http://sourceserver; } } [client] you can run this simple python script: #!/usr/bin/python import socket import time s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) s.connect((127.0.0.1, 5821)) s.send("GET /data/something HTTP/1.0\r\n\r\n") buf = s.recv(100) print buf time.sleep(100) Then, in access.log, you will find that the request is finished in 20s. Best Regads, Wu At 2011-05-19 19:38:42?"Maxim Dounin" wrote: >Hello! > >On Thu, May 19, 2011 at 10:39:43AM +0800, Wu Bingzheng wrote: > >> Hi Maxim, >> >> Thanks for your answer. But I am still confused. >> >> >> At 2011-05-18 21:35:07?"Maxim Dounin" wrote: >> >> >Hello! >> > >> >On Wed, May 18, 2011 at 05:15:00PM +0800, Wu Bingzheng wrote: >> > >> >> hi all, >> >> >> >> >> >> I meet 2 question when using nginx 1.0.0. >> >> >> >> >> >> Question1. >> >> >> >> what happens if the downstream connection breaks, before all >> >> data sent to the client? >> >> >> >> 1. get client's request >> >> 2. set handler: r->read_event_handle=ngx_http_block_reading >> >> 3. send data to client, and blocked ( >> >> write_filter.c:c->send_chain() returns non-NULL or non-error), >> >> and go back to epoll_wait >> >> 4. HERE, the downstream breaks >> >> 5. epoll detect the breaking, so epoll_wait() continues in >> >> ngx_epoll_process_events(), where the revents==EPOLL_IN | >> >> EPOLL_ERR | EPOLL_HUP. So we call rev->handler(), which calls >> >> r->read_event_handle, which dose nothing. AS A RESULT, the >> >> downstream breaking was not detected by nginx !!! >> > >> >Here write event handler will be called. While standard >> >ngx_http_writer() is in use - it will call output filter chain and >> >detect error. Else it's up to active handler to correctly handle >> >this, e.g. standard upstream modules (proxy/fastcgi/...) may >> >either terminate request immediately or wait for full upstream >> >response depending on various settings (proxy_ignore_client_abort, >> >proxy_cache/proxy_store enabled). >> > >> >> You said the write handler will be called. But if a connection >> is break, revents returned by epoll_wait() is 'EPOLL_IN | >> EPOLL_ERR | EPOLL_HUP', and no EPOLL_OUT in revents. So I think >> the write-handler will NOT be called. > >Ah, ok, it looks like I was wrong here. Write handler will be >only called if there are no EPOLLIN flag in revents, and this is >probably wrong assuming EPOLLHUP follows the same semantics as >POLLHUP[1], i.e. > >POLLHUP >... This event and POLLOUT are mutually-exclusive; a stream can >never be writable if a hangup has occurred. ... > >Could you please provide detailed instructions to reproduce the >problem, preferably with standard modules involved? > >[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html > >> The FACT is, in my server, there are many many access logs whose >> time-taken are 40.001s. (send_timeout is 20s, and this is a >> music online server, so many people re-choose a song before the >> current song finishs, which means the downstream breaks before >> nginx sends all data). >> >> I add 2 debug log in ngx_epoll_process_events(), and copy part >> of the debug log here. > >Just a side note: mostly same information may be seen at global >level debug log. > >[...] > >> >> I set 'send_timeout' as 20s, but nginx timeouts in 40s actually. >> >> >> >> 1. in >> >> src/http/ngx_http_upstream.c[line2448]:ngx_http_upstream_process_non_buffered_request(), >> >> a timer is added; >> >> 2. after that timer timeout, in >> >> src/http/ngx_http_request.c[line2179]:ngx_http_set_write_handler(), >> >> another timer is added again. >> >> >> >> so the send_timeout is doubled. >> > >> >Timeout is re-set on each send operation, and expected to be >> >triggered when nothing happens during send_timeout. >> >> So, you think that, I set 'send_timeout' as 20s, but nginx >> actually timeout in 40s is right and expected? > >It should timeout in 20s after last send. Whether request time >of 40s is wrong or not depends on many factors, but the code you >pointed out looks fine. > >Note also that in debug log you provided nginx correctly times out >after 20s from last send. > >Maxim Dounin From joshua.pearce at gmail.com Fri May 20 05:54:41 2011 From: joshua.pearce at gmail.com (Joshua Pearce) Date: Thu, 19 May 2011 21:54:41 -0400 Subject: How to Set Expires With Try Files Message-ID: <5E68732E-D6D1-45DA-B2A5-85E65687FC72@gmail.com> Below is my config file. How can I change the two "if" blocks to try_files, and still do a 30d expires for static files? server { listen 80; server_name www.joshpearce.org; client_max_body_size 4M; access_log /var/log/nginx/localhost.access.log; # root of website *exactly*, use '=' for speed location = / { root /var/www/joshpearce.org; index index.php index.html index.htm; } location / { root /var/www/joshpearce.org; index index.php index.html index.htm; if (-f $request_filename) { expires 30d; break; } if (!-e $request_filename) { rewrite ^(.+)$ /index.php?q=$1 last; } } # use: htpasswd - htpwds NewUser NewPassword location ^~ /info { auth_basic "Restricted"; auth_basic_user_file /etc/nginx/htpwds; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/usr/local/var/run/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/joshpearce.org$fastcgi_script_name; } location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass unix:/usr/local/var/run/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/joshpearce.org$fastcgi_script_name; } #error_page 404 /404.html; } From igor at sysoev.ru Fri May 20 09:34:36 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 20 May 2011 09:34:36 +0400 Subject: Rewrite or internal redirection cycle? In-Reply-To: <0843318a97adce238d8a671167f03ead.NginxMailingListEnglish@forum.nginx.org> References: <0843318a97adce238d8a671167f03ead.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110520053436.GB73208@sysoev.ru> On Thu, May 19, 2011 at 09:20:55AM -0400, TECK wrote: > Hi, > > I'm having a bit of an issue with the rewrite scheme: > > server { > ... > location / { > try_files $uri $uri/ @data; > } > > location @data { > rewrite ^ /data.php$is_args; > internal; > } > ... > } > > When I access this request: > http://domain.com/information/feedback/?order=desc&sort=date > > I get an internal redirection cycle: > *1 rewrite or internal redirection cycle while processing "/data.php?", > client: IP, server: domain.com, request: "GET > /information/feedback/?order=desc&sort=date HTTP/1.1", host: > "domain.com", referrer: "http://domain.com/information/feedback/" > > However, if I access this request: > http://domain.com/information/feedback/400028-some-information.html > > Everything works properly. What do you recommend to do, in order to > troubleshoot the issue? > My goal is to actually log what goes wrong with the php code, when the > redirection cycle is encountered. > > Thanks for your help. You should either add "break" to stop internal redirection cycle: location @data { rewrite ^ /data.php$args break; } or should define /data.php in try_files location / { try_files $uri $uri/ /index.php?$args; } or (my favorite) should define exactly what nginx should do in @data: location @data { fastcgi_pass ... fastcgi_param SCRIPT_FILENAME /path/to/data.php; ... } The later way looks more complex at the first sight, but it creates independed locations and allows configuration to grow at very large scale. -- Igor Sysoev From igor at sysoev.ru Fri May 20 09:36:15 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 20 May 2011 09:36:15 +0400 Subject: How to Set Expires With Try Files In-Reply-To: <5E68732E-D6D1-45DA-B2A5-85E65687FC72@gmail.com> References: <5E68732E-D6D1-45DA-B2A5-85E65687FC72@gmail.com> Message-ID: <20110520053615.GC73208@sysoev.ru> On Thu, May 19, 2011 at 09:54:41PM -0400, Joshua Pearce wrote: > Below is my config file. How can I change the two "if" blocks to try_files, and still do a 30d expires for static files? > > server { > listen 80; > server_name www.joshpearce.org; > client_max_body_size 4M; > access_log /var/log/nginx/localhost.access.log; > > # root of website *exactly*, use '=' for speed > location = / { > root /var/www/joshpearce.org; > index index.php index.html index.htm; > } > location / { > root /var/www/joshpearce.org; > index index.php index.html index.htm; > if (-f $request_filename) { > expires 30d; > break; > } > if (!-e $request_filename) { > rewrite ^(.+)$ /index.php?q=$1 last; > } > } > # use: htpasswd - htpwds NewUser NewPassword > location ^~ /info { > auth_basic "Restricted"; > auth_basic_user_file /etc/nginx/htpwds; > include /etc/nginx/fastcgi_params; > fastcgi_pass unix:/usr/local/var/run/php-fpm.sock; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME /var/www/joshpearce.org$fastcgi_script_name; > } > location ~ \.php$ { > include /etc/nginx/fastcgi_params; > fastcgi_pass unix:/usr/local/var/run/php-fpm.sock; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME /var/www/joshpearce.org$fastcgi_script_name; > } > > #error_page 404 /404.html; > } You do not need this block: if (-f $request_filename) { expires 30d; break; } at all, since nginx adds Expires only to existant files. -- Igor Sysoev From agentzh at gmail.com Fri May 20 10:51:40 2011 From: agentzh at gmail.com (agentzh) Date: Fri, 20 May 2011 14:51:40 +0800 Subject: lua: ngx.location.capture / limit proxy_cache individual file size In-Reply-To: References: Message-ID: On Fri, May 20, 2011 at 2:15 AM, Richard Kearsley wrote: > Is it possible to do a version of ngx.location.capture that only does a HEAD > request rather than GET? > Please try ngx.location.capture("/some-location", { method = ngx.HTTP_HEAD }) If it does not work, please consider file a bug ticket on GitHub: https://github.com/chaoslawful/lua-nginx-module/issues > I?m only interested in the headers returned, the body would make what I?m > trying to do pointless L > *nod* Best, -agentzh From nginx-forum at nginx.us Fri May 20 10:54:31 2011 From: nginx-forum at nginx.us (arti) Date: Fri, 20 May 2011 02:54:31 -0400 Subject: File AIO and multiple nginx instances In-Reply-To: References: Message-ID: <55e75e5fcfcc8847d08de521525d9d1b.NginxMailingListEnglish@forum.nginx.org> So, is it a problem of CentOS or Nginx? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198945,199437#msg-199437 From igor at sysoev.ru Fri May 20 10:56:55 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 20 May 2011 10:56:55 +0400 Subject: File AIO and multiple nginx instances In-Reply-To: <55e75e5fcfcc8847d08de521525d9d1b.NginxMailingListEnglish@forum.nginx.org> References: <55e75e5fcfcc8847d08de521525d9d1b.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110520065655.GD73208@sysoev.ru> On Fri, May 20, 2011 at 02:54:31AM -0400, arti wrote: > So, is it a problem of CentOS or Nginx? I believe this is a CentOS issue, and man page does not allow even to understand what is the issue. -- Igor Sysoev From nginx-forum at nginx.us Fri May 20 10:59:50 2011 From: nginx-forum at nginx.us (arti) Date: Fri, 20 May 2011 02:59:50 -0400 Subject: File AIO and multiple nginx instances In-Reply-To: <20110520065655.GD73208@sysoev.ru> References: <20110520065655.GD73208@sysoev.ru> Message-ID: <1a2f3404dc4a9235351601fff53a16c7.NginxMailingListEnglish@forum.nginx.org> Ok, thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198945,199439#msg-199439 From mdounin at mdounin.ru Fri May 20 12:00:06 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 20 May 2011 12:00:06 +0400 Subject: Disabling basic_auth with rewrites In-Reply-To: <20110519191656.GA48682@sysoev.ru> References: <20110519140950.GB42265@mdounin.ru> <9739b40539caebc9cbb3d3c9dc3cdecd.NginxMailingListEnglish@forum.nginx.org> <20110519181059.GD42265@mdounin.ru> <20110519191656.GA48682@sysoev.ru> Message-ID: <20110520080006.GE42265@mdounin.ru> Hello! On Thu, May 19, 2011 at 11:16:56PM +0400, Igor Sysoev wrote: > On Thu, May 19, 2011 at 10:10:59PM +0400, Maxim Dounin wrote: > > Hello! > > > > On Thu, May 19, 2011 at 12:43:03PM -0400, klausi wrote: > > > > > Maxim Dounin Wrote: > > > ------------------------------------------------------- > > > > > > > > location / { > > > > auth_basic "protected"; > > > > auth_basic_user_file > > > > /etc/nginx/htpasswd/protected; > > > > ... > > > > > > > > location ~ \.php$ { > > > > fastcgi_pass ... > > > > ... > > > > } > > > > } > > > > > > > > location /feeds/importer/ { > > > > ... > > > > > > > > location ~ \.php$ { > > > > fastcgi_pass ... > > > > ... > > > > } > > > > } > > > > > > Thanks for the quick reply, nested locations are nice, but they do not > > > help in this special case. A request to /feeds/importer/* has to be > > > rewritten to /index.php?q=feeds/importer/* and that should not be > > > protected. Is unprotecting a path with a special query possible at all? > > > > Ah, sorry, I missed you actually want /feeds/importer/... to be > > fully handled by index.php. This makes configuration even > > simplier: > > > > location / { > > auth_basic ... > > ... > > > > location ~ \.php$ { > > fastcgi_pass ... > > ... > > } > > } > > > > location /feeds/importer/ { > > rewrite ^/(.*) /index.php?q=$1? break; > > > > fastcgi_pass ... > > ... > > } > > > > Note that the only goal of rewrite is to properly change url while > > correctly escaping new arguments and stripping old ones (note > > trailing '?'), as you probably don't want to allow unauthenticated > > users to supply arbitrary arguments to your index.php. Due to > > 'break' request doesn't leave the location in question after > > rewrite and processed there. > > My suggestion is to not use rewrite at all: > > location /feeds/importer/ { > location ~ ^/(.*) { > fastcgi_pass ... > fastcgi_param SCRIPT_FILENAME /path/to/index.php; > fastcgi_param QUERY_STRING q=$1; > ... > } There is a problem: you need urlescape() function then. Else request like /feeds/importer/&doevil=1 will naturally do evil, i.e. "doevil=1" will be seen by index.php as a separate argument. Maxim Dounin From mdounin at mdounin.ru Fri May 20 13:40:33 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 20 May 2011 13:40:33 +0400 Subject: [NGINX] cache process manager consume a lot of CPU at reload and has to be restarted In-Reply-To: <5574016561bfd454ad04bd477e558e06.NginxMailingListEnglish@forum.nginx.org> References: <5574016561bfd454ad04bd477e558e06.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110520094033.GF42265@mdounin.ru> Hello! On Thu, May 19, 2011 at 03:51:11PM -0400, omega8cc wrote: > Unfortunately, it still happens also for 1.0.2 release. > > I have seen it over 10 times on two different servers since upgrade to > 1.0.0, then 1.0.1 and 1.0.2. > > Not sure how to debug this, as it is random issue, yet causes downtime > until our auto-healing will kill all nginx processes and wait for load > to stabilize to start nginx again. There were two issues discussed in this thread which caused cpu hog in cache manager: 1. Earlier SIGSEGV in worker process while holding cache zone lock with resulting ngx_spinlock() loop in cache manager. Fix is to trace and fix this earlier SIGSEGV (looking though error log should help, btw). 2. Cache manager was looping if it wasn't able to made any progress. This was fixed in 1.0.0 (patch present in this thread was committed). I suspect your problem is (1), though it may be some other problem as well. Please provide at least backtrace of runaway process to make further debugging possible. This may be done with # gdb /path/to/nginx bt (and please make sure your binary isn't stripped, else backtrace will contain only '??' instead of function names) Running something like ktrace/strace may be also helpfull. Maxim Dounin From mdounin at mdounin.ru Fri May 20 14:20:56 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 20 May 2011 14:20:56 +0400 Subject: Randomly stopping large file downloads? In-Reply-To: References: Message-ID: <20110520102056.GG42265@mdounin.ru> Hello! On Thu, May 19, 2011 at 04:34:34PM -0400, nickn wrote: > Hi, > 1.) What would cause nginx to randomly stop serving large file > downloads? When I try to download a 800MB file it stops serving the file > after between 10 and 30 MB. I've had to revert to lighttpd because of > this. Are you serving file as static one with nginx, or proxy_pass to some backend server? In later case most likely reason is out of space (or no access to) in proxy_temp_path. > I checked the usual things: There wasn't anything in the error log, the > system had plenty of memory (several hundred MB free) and the worker > processes were all still there after the download dies. It doesn't > matter what browser I use. > > Any idea what would cause this? Please make sure you have error_log properly configured and you are looking at right one. Most simple aproach is to configure one at global level and remove others if any (i.e. at http, server, etc. levels), e.g. error_log /path/to/error.log info; Note that setting logging level to 'info' may be important in some cases (e.g. if nginx thinks client timed out or so on). If the above wouldn't be enough to solve you problem, please follow generic instructions as outlined at http://wiki.nginx.org/Debugging, i.e. please provide 1. nginx -V output 2. full nginx config 3. debug log Maxim Dounin From mdounin at mdounin.ru Fri May 20 14:23:09 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 20 May 2011 14:23:09 +0400 Subject: try_files In-Reply-To: <4DD5953C.7030202@styleflare.com> References: <4DD5953C.7030202@styleflare.com> Message-ID: <20110520102309.GH42265@mdounin.ru> Hello! On Thu, May 19, 2011 at 06:10:04PM -0400, David J. wrote: > I have a uwsgi_app > > I was wondering why > > location / { > root /myapp; > index index.html index.wsgi; > try_files $uri $uri/ @wsgi; > } > ; > > When I visit the domain.com returns a 403 (when I dont have an > index.html file in the root directory); > > but if I do domain.com/index.wsgi > > The WSGI app is called. This all works. > > I am guessing I am doing something wrong. > > In my config I have > > location @wsgi { > include uwsgi_params; > uwsgi_pass unix:/tmp/uwsgi.sock > } Please show full config. Maxim Dounin From david at styleflare.com Fri May 20 14:57:23 2011 From: david at styleflare.com (David J.) Date: Fri, 20 May 2011 06:57:23 -0400 Subject: try_files In-Reply-To: <20110520102309.GH42265@mdounin.ru> References: <4DD5953C.7030202@styleflare.com> <20110520102309.GH42265@mdounin.ru> Message-ID: <4DD64913.6080509@styleflare.com> Running Nginx v1.0.0 Here is server config server { listen 80; server_name domain.com www.domain.com; location /{ index index.html index index.htm index.php; root /www/domain.com; try_files $uri $uri/ @wsgi; } location @wsgi { index index.html index.htm; include uwsgi_params; uwsgi_pass unix:/tmp/uwsgi.sock; } location ~ \.css$ { root /www/domain.com; } } On 5/20/11 6:23 AM, Maxim Dounin wrote: > Hello! > > On Thu, May 19, 2011 at 06:10:04PM -0400, David J. wrote: > >> I have a uwsgi_app >> >> I was wondering why >> >> location / { >> root /myapp; >> index index.html index.wsgi; >> try_files $uri $uri/ @wsgi; >> } >> ; >> >> When I visit the domain.com returns a 403 (when I dont have an >> index.html file in the root directory); >> >> but if I do domain.com/index.wsgi >> >> The WSGI app is called. This all works. >> >> I am guessing I am doing something wrong. >> >> In my config I have >> >> location @wsgi { >> include uwsgi_params; >> uwsgi_pass unix:/tmp/uwsgi.sock >> } > Please show full config. > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > From igor at sysoev.ru Fri May 20 15:06:58 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 20 May 2011 15:06:58 +0400 Subject: Proxy_pass and slash witch nginx In-Reply-To: <0cbde934384bd99d3e3d381c2346af82.NginxMailingListEnglish@forum.nginx.org> References: <20110518195045.GX42265@mdounin.ru> <0cbde934384bd99d3e3d381c2346af82.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110520110658.GA95649@sysoev.ru> On Thu, May 19, 2011 at 04:37:38PM -0400, myckeul wrote: > Hello, > > Thanks for your response but they won't working. > my vhost : > server { > listen [::]:80; > > server_name proxy.com *.proxy.com; > > access_log /var/log/nginx/proxy_.access.log; > > error_page 404 = /404.htm; > > location /404.htm { > root /var/www; > } > > location / { > 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; > > > if ($host ~* ^proxy\.com$) { > proxy_pass http://mydomain.com; > } > > if ($host ~* ^www\.proxy\.com$) { > proxy_pass http://www.mydomain.com; > } > > if ($host ~* ^subdomain\.proxy\.com$) { > proxy_pass http://subdomain.mydomain.com; > } > > proxy_redirect http://proxy.com/test http://proxy.com/test/; > } > } proxy_redirect http://mydomain.com http://proxy.com; proxy_redirect http://www.mydomain.com http://www.proxy.com; proxy_redirect http://subdomain.mydomain.com http://subdomain.proxy.com; BTW, your configuraiton is wrong mix of levels: you should not use virtual host name on location level in "if ($host ~". This leads to cumbersome and unmaintainable configurations. Instead you should define 3 separate servers: server { server_name proxy.com; location / { proxy_pass http://mydomain.com; } ... } server { server_name www.proxy.com; location / { proxy_pass http://www.mydomain.com; } ... } server { server_name subdomain.proxy.com; location / { proxy_pass http://subdomain.mydomain.com; } ... } -- Igor Sysoev From igor at sysoev.ru Fri May 20 15:19:52 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 20 May 2011 15:19:52 +0400 Subject: Rewrite rule for nginx from Apache In-Reply-To: References: Message-ID: <20110520111952.GC95649@sysoev.ru> On Wed, May 18, 2011 at 10:52:39PM -0400, ltss wrote: > Hello i am new to nginx and i need some help to convert my .htaccess, i > have tried some shit but that not work ... > > Options FollowSymLinks > RewriteEngine On > > RewriteRule ^(.*)\.php/img/(.*)$ img/$2 [C] > RewriteRule ^/img/(.*)$ img/$2 [QSA,L] > > RewriteCond %{REQUEST_FILENAME} !^scriptsFtp.*$ > > RewriteCond %{REQUEST_FILENAME} !-d > RewriteCond %{REQUEST_FILENAME} !-f > RewriteRule ^(.*)$ index.php [QSA,L] It's not easy to understand what these .htaccess should do. Probably this: root /path/to/files; location / { try_files $uri $uri/ /index.php?$args; } location /scriptsFtp { ... } location ~ ^(.*)\.php/img/(.*)$ { alias /path/to/img/$2; } location ~ .php$ { fastcgi_pass ... ... } -- Igor Sysoev From Richard.Kearsley at m247.com Fri May 20 15:32:56 2011 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Fri, 20 May 2011 11:32:56 +0000 Subject: lua location capture In-Reply-To: References: Message-ID: Hi Thanks for the reply I traced the issue with the header's not being re-sent ngx.location.capture("/some-location", { method = ngx.HTTP_HEAD }) they are not re-sent but ngx.location.capture("/some-location", { method = ngx.HTTP_GET }) they are sent I don't know if this is correct behavior (it may well be) I got around it by changing the headers I needed into args then re-creating them at /some-location :( -----Original Message----- From: agentzh [mailto:agentzh at gmail.com] Sent: 20 May 2011 04:56 To: nginx at nginx.org Subject: Re: lua location capture On Fri, May 20, 2011 at 5:59 AM, Richard Kearsley wrote: > Hi > > The lua doc at https://github.com/chaoslawful/lua-nginx-module > > Says "Note that, by default, subrequests issued by ngx.location.capture > inherit all the request headers of the current request." > > And goes on to say that it can be an unwanted feature > > In my project I actually take advantage of this feature, but for some reason > the headers don't go through to the sub request > Could you please paste your nginx.conf here? Also, information about your nginx's version and ngx_lua's version can also be helpful :) Best, -agentzh _______________________________________________ nginx mailing list nginx at nginx.org http://nginx.org/mailman/listinfo/nginx From mdounin at mdounin.ru Fri May 20 15:33:15 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 20 May 2011 15:33:15 +0400 Subject: 2 questions on send_timeout (maybe bugs) In-Reply-To: <76e2ab59.13e9e.1300b8dcee7.Coremail.wubingzheng@163.com> References: <20110519113842.GA42265@mdounin.ru> <20110518133507.GV42265@mdounin.ru> <10a6803e.1907c.130026300cb.Coremail.wubingzheng@163.com> <54e4f427.3d5f.130061f7663.Coremail.wubingzheng@163.com> <76e2ab59.13e9e.1300b8dcee7.Coremail.wubingzheng@163.com> Message-ID: <20110520113314.GI42265@mdounin.ru> Hello! On Fri, May 20, 2011 at 11:58:20AM +0800, Wu Bingzheng wrote: > Hi Maxim, > > 1. > I am so sorry that I made a big mistake on question 1. > Nginx didn't detect the downstream breaking, because I use "proxy_ignore_client_abort on;". > So Nginx works correctlly. I am so sorry about it. I believe the problem may still appear with normal usage once upstream connection terminates, EPOLLHUP handling in epoll event module doesn't look correct for me. This should be investigated further. > 2. > For question 2. > You said that : > >Note also that in debug log you provided nginx correctly times out > >after 20s from last send. > > That's because I set the send_timeout as 10s. I am sorry that I did not make clear of that. > > You can reproduce the doubled timeout easy: Ok, I was able to reproduce this and see the problem. Indeed, when upstream module detects client timeout it doesn't finalize request properly, and as a result http core thinks it should continue sending data in buffers and hence waits for another timeout. Quick fix for this particular problem would be something like diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -2320,7 +2320,7 @@ ngx_http_upstream_process_non_buffered_d if (wev->timedout) { c->timedout = 1; ngx_connection_error(c, NGX_ETIMEDOUT, "client timed out"); - ngx_http_upstream_finalize_request(r, u, 0); + ngx_http_upstream_finalize_request(r, u, NGX_HTTP_REQUEST_TIME_OUT); return; } @@ -3013,6 +3013,7 @@ ngx_http_upstream_finalize_request(ngx_h #endif if (u->header_sent + && rc != NGX_HTTP_REQUEST_TIME_OUT && (rc == NGX_ERROR || rc >= NGX_HTTP_SPECIAL_RESPONSE)) { rc = 0; Though upstream module certainly requires larger cleanup of error handling. This is not the first time I've been bitten by upstream not finalizing requests properly. Maxim Dounin > > [server] using nginx-1.0.0, without any addon module. in nginx.conf: > > server { > listen 5821; > proxy_buffering off; #must in non-buffering mode > send_timeout 10; > > location / { > proxy_pass http://sourceserver; > } > } > > > > [client] you can run this simple python script: > > #!/usr/bin/python > import socket > import time > s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) > s.connect((127.0.0.1, 5821)) > s.send("GET /data/something HTTP/1.0\r\n\r\n") > buf = s.recv(100) > print buf > time.sleep(100) > > > > Then, in access.log, you will find that the request is finished in 20s. > > > Best Regads, > Wu > > > > > > > > > At 2011-05-19 19:38:42?"Maxim Dounin" wrote: > > >Hello! > > > >On Thu, May 19, 2011 at 10:39:43AM +0800, Wu Bingzheng wrote: > > > >> Hi Maxim, > >> > >> Thanks for your answer. But I am still confused. > >> > >> > >> At 2011-05-18 21:35:07?"Maxim Dounin" wrote: > >> > >> >Hello! > >> > > >> >On Wed, May 18, 2011 at 05:15:00PM +0800, Wu Bingzheng wrote: > >> > > >> >> hi all, > >> >> > >> >> > >> >> I meet 2 question when using nginx 1.0.0. > >> >> > >> >> > >> >> Question1. > >> >> > >> >> what happens if the downstream connection breaks, before all > >> >> data sent to the client? > >> >> > >> >> 1. get client's request > >> >> 2. set handler: r->read_event_handle=ngx_http_block_reading > >> >> 3. send data to client, and blocked ( > >> >> write_filter.c:c->send_chain() returns non-NULL or non-error), > >> >> and go back to epoll_wait > >> >> 4. HERE, the downstream breaks > >> >> 5. epoll detect the breaking, so epoll_wait() continues in > >> >> ngx_epoll_process_events(), where the revents==EPOLL_IN | > >> >> EPOLL_ERR | EPOLL_HUP. So we call rev->handler(), which calls > >> >> r->read_event_handle, which dose nothing. AS A RESULT, the > >> >> downstream breaking was not detected by nginx !!! > >> > > >> >Here write event handler will be called. While standard > >> >ngx_http_writer() is in use - it will call output filter chain and > >> >detect error. Else it's up to active handler to correctly handle > >> >this, e.g. standard upstream modules (proxy/fastcgi/...) may > >> >either terminate request immediately or wait for full upstream > >> >response depending on various settings (proxy_ignore_client_abort, > >> >proxy_cache/proxy_store enabled). > >> > > >> > >> You said the write handler will be called. But if a connection > >> is break, revents returned by epoll_wait() is 'EPOLL_IN | > >> EPOLL_ERR | EPOLL_HUP', and no EPOLL_OUT in revents. So I think > >> the write-handler will NOT be called. > > > >Ah, ok, it looks like I was wrong here. Write handler will be > >only called if there are no EPOLLIN flag in revents, and this is > >probably wrong assuming EPOLLHUP follows the same semantics as > >POLLHUP[1], i.e. > > > >POLLHUP > >... This event and POLLOUT are mutually-exclusive; a stream can > >never be writable if a hangup has occurred. ... > > > >Could you please provide detailed instructions to reproduce the > >problem, preferably with standard modules involved? > > > >[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html > > > >> The FACT is, in my server, there are many many access logs whose > >> time-taken are 40.001s. (send_timeout is 20s, and this is a > >> music online server, so many people re-choose a song before the > >> current song finishs, which means the downstream breaks before > >> nginx sends all data). > >> > >> I add 2 debug log in ngx_epoll_process_events(), and copy part > >> of the debug log here. > > > >Just a side note: mostly same information may be seen at global > >level debug log. > > > >[...] > > > >> >> I set 'send_timeout' as 20s, but nginx timeouts in 40s actually. > >> >> > >> >> 1. in > >> >> src/http/ngx_http_upstream.c[line2448]:ngx_http_upstream_process_non_buffered_request(), > >> >> a timer is added; > >> >> 2. after that timer timeout, in > >> >> src/http/ngx_http_request.c[line2179]:ngx_http_set_write_handler(), > >> >> another timer is added again. > >> >> > >> >> so the send_timeout is doubled. > >> > > >> >Timeout is re-set on each send operation, and expected to be > >> >triggered when nothing happens during send_timeout. > >> > >> So, you think that, I set 'send_timeout' as 20s, but nginx > >> actually timeout in 40s is right and expected? > > > >It should timeout in 20s after last send. Whether request time > >of 40s is wrong or not depends on many factors, but the code you > >pointed out looks fine. > > > >Note also that in debug log you provided nginx correctly times out > >after 20s from last send. > > > >Maxim Dounin > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx From mdounin at mdounin.ru Fri May 20 16:12:27 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 20 May 2011 16:12:27 +0400 Subject: try_files In-Reply-To: <4DD64913.6080509@styleflare.com> References: <4DD5953C.7030202@styleflare.com> <20110520102309.GH42265@mdounin.ru> <4DD64913.6080509@styleflare.com> Message-ID: <20110520121227.GJ42265@mdounin.ru> Hello! On Fri, May 20, 2011 at 06:57:23AM -0400, David J. wrote: > Running Nginx v1.0.0 > > Here is server config > > server { > listen 80; > server_name domain.com www.domain.com; > location /{ > index index.html index index.htm index.php; > root /www/domain.com; > try_files $uri $uri/ @wsgi; > } > > location @wsgi { > index index.html index.htm; > include uwsgi_params; > > uwsgi_pass unix:/tmp/uwsgi.sock; > } > location ~ \.css$ { > root /www/domain.com; > } > > } It doesn't looks like you have "index" directive set to "index.wsgi" nor any actual handling of index.wsgi (except try_files fallback). This all makes me think that you actually don't have index.wsgi on filesystem either. Note that "index" directive will actually test existence of given index files on filesystem and will do an internal redirect if one was found. That is, if you don't have any index files on filesystem - you'll get 403 (unless autoindex module enabled). The configuration you probably want is something like root /www/domain.com; location / { try_files $uri $uri/index.html @wsgi; } location @wsgi { uwsgi_pass ... } That is: if file exists, return it; if there is a directory with index.html, return it; else fallback to wsgi. Maxim Dounin > > > On 5/20/11 6:23 AM, Maxim Dounin wrote: > >Hello! > > > >On Thu, May 19, 2011 at 06:10:04PM -0400, David J. wrote: > > > >>I have a uwsgi_app > >> > >>I was wondering why > >> > >>location / { > >>root /myapp; > >>index index.html index.wsgi; > >>try_files $uri $uri/ @wsgi; > >>} > >>; > >> > >>When I visit the domain.com returns a 403 (when I dont have an > >>index.html file in the root directory); > >> > >>but if I do domain.com/index.wsgi > >> > >>The WSGI app is called. This all works. > >> > >>I am guessing I am doing something wrong. > >> > >>In my config I have > >> > >>location @wsgi { > >> include uwsgi_params; > >> uwsgi_pass unix:/tmp/uwsgi.sock > >>} > >Please show full config. > > > >Maxim Dounin > > > >_______________________________________________ > >nginx mailing list > >nginx at nginx.org > >http://nginx.org/mailman/listinfo/nginx > > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx From lists at ruby-forum.com Fri May 20 21:14:44 2011 From: lists at ruby-forum.com (Yanxin Z.) Date: Fri, 20 May 2011 19:14:44 +0200 Subject: nginx for multiple sub-domain? Message-ID: <7136024a70c9eb0cac6f94538240d973@ruby-forum.com> Hello, I have a web site, e.g., www.example.com under it, i have several sub-domains, e.g., /register, /query, /report. I have a requirement that, /query is for port 80 /register is for port 443, but with server side SSL certificate verification. /report is for port 443 , with both server and client side SSL certificate verification. I want to know whether NGX config can do this ? I have the problem to config /register and /report under port 443. Thanks, Yanxin -- Posted via http://www.ruby-forum.com/. From igor at sysoev.ru Fri May 20 22:00:06 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 20 May 2011 22:00:06 +0400 Subject: nginx for multiple sub-domain? In-Reply-To: <7136024a70c9eb0cac6f94538240d973@ruby-forum.com> References: <7136024a70c9eb0cac6f94538240d973@ruby-forum.com> Message-ID: <20110520180006.GB9846@sysoev.ru> On Fri, May 20, 2011 at 07:14:44PM +0200, Yanxin Z. wrote: > Hello, > I have a web site, e.g., www.example.com > under it, i have several sub-domains, e.g., /register, /query, /report. > > I have a requirement that, > /query is for port 80 > /register is for port 443, but with server side SSL certificate > verification. > /report is for port 443 , with both server and client side SSL > certificate verification. > > I want to know whether NGX config can do this ? > > > I have the problem to config /register and /report under port 443. server { listen 80; server_name www.example.com; location /query { ... } } server { listen 443; server_name www.example.com; ssl on; ssl_certificate www.nginx.com.crt; ssl_certificate_key www.nginx.com.key; ssl_verify_client optional; ssl_client_certificate CA.crt; location /register { ... } location /report { if ($ssl_client_verify != SUCCESS) { return 403; } ... } } http://nginx.org/en/docs/http/configuring_https_servers.html -- Igor Sysoev From nginx-forum at nginx.us Fri May 20 22:40:10 2011 From: nginx-forum at nginx.us (TECK) Date: Fri, 20 May 2011 14:40:10 -0400 Subject: Rewrite or internal redirection cycle? In-Reply-To: <20110520053436.GB73208@sysoev.ru> References: <20110520053436.GB73208@sysoev.ru> Message-ID: <0e8e32f8c2b80c2ad13a35f3005a9abc.NginxMailingListEnglish@forum.nginx.org> Thank you Igor, I will use the SCRIPT_FILENAME setup. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199260,199596#msg-199596 From lists at ruby-forum.com Fri May 20 22:50:09 2011 From: lists at ruby-forum.com (Yanxin Z.) Date: Fri, 20 May 2011 20:50:09 +0200 Subject: nginx for multiple sub-domain? In-Reply-To: <7136024a70c9eb0cac6f94538240d973@ruby-forum.com> References: <7136024a70c9eb0cac6f94538240d973@ruby-forum.com> Message-ID: <028c9c62aa3970a88144d3fbfb996d2f@ruby-forum.com> Thank you Igor!! NGX is so powerful. It's working for me. Another question, for CA cert, I also need to verify PEM pass phase. Can I do it in NGX config? Thanks, Yanxin -- Posted via http://www.ruby-forum.com/. From nginx-forum at nginx.us Fri May 20 23:43:53 2011 From: nginx-forum at nginx.us (nickn) Date: Fri, 20 May 2011 15:43:53 -0400 Subject: Randomly stopping large file downloads? In-Reply-To: <20110520102056.GG42265@mdounin.ru> References: <20110520102056.GG42265@mdounin.ru> Message-ID: <908b73582b85537775efe9c692b948c5.NginxMailingListEnglish@forum.nginx.org> Hi Maxim, thanks for your help. I'm not using a proxy, it's just a straight connection to nginx. I ran it again with error log on info and found that it thinks the client is timing out, although watching firefox it seemed to be downloading ok the entire time and I wasn't having connectivity issues on other sites. I tried keepalive_timeout 65; rather than 5 but had the same problem. Here's the info below, any ideas what it could be? ---- /var/log/nginx# tail cosmic-access.log 76.250.143.130 - - [20/May/2011:19:32:50 +0000] "GET /bigfile.sql.gz HTTP/1.1" 200 114499284 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17" /var/log/nginx# tail cosmic-error.log 2011/05/20 19:32:50 [info] 12222#0: *10 client timed out (110: Connection timed out) while sending response to client, client: 76.250.143.130, server: cosmicchannelings.com, request: "GET /bigfile.sql.gz HTTP/1.1", host: "cosmicchannelings.com:81" root at 217948:/var/log/nginx# nginx -V nginx version: nginx/0.7.65 TLS SNI support enabled configure arguments: --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug --with-http_stub_status_module --with-http_flv_module --with-http_ssl_module --with-http_dav_module --with-http_gzip_static_module --with-http_realip_module --with-mail --with-mail_ssl_module --with-ipv6 --add-module=/build/buildd/nginx-0.7.65/modules/nginx-upstream-fair --------- /etc/nginx/nginx.conf: --------- user www-data; #worker_processes 1; worker_processes 2; pid /var/run/nginx.pid; events { worker_connections 1024; # multi_accept on; } http { include /etc/nginx/mime.types; error_log /var/log/nginx/error.log info; access_log /var/log/nginx/access.log; sendfile on; #tcp_nopush on; #keepalive_timeout 0; #keepalive_timeout 65; keepalive_timeout 5; tcp_nodelay on; # gzip on; # gzip_disable "MSIE [1-6]\.(?!.*SV1)"; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } # mail { # # See sample authentication script at: # # http://wiki.nginx.org/NginxImapAuthenticateWithApachePhpScript # # # auth_http localhost/auth.php; # # pop3_capabilities "TOP" "USER"; # # imap_capabilities "IMAP4rev1" "UIDPLUS"; # # server { # listen localhost:110; # protocol pop3; # proxy on; # } # # server { # listen localhost:143; # protocol imap; # proxy on; # } # } --------------- /etc/nginx/sites-enabled/sites-enabled/cosmic: --------------- # You may add here your # server { # ... # } # statements for each of your virtual hosts server { listen 81; server_name cosmicchannelings.com www.cosmicchannelings.com; # access_log /var/log/apache2/cosmic-access.log; # error_log /var/log/apache2/cosmic-error.log; access_log /var/log/nginx/cosmic-access.log; error_log /var/log/nginx/cosmic-error.log info; root /var/www/cosmic; index index.php index.html index.htm; # wordpress url writing error_page 404 /blog/index.php; if ($http_user_agent ~ "magpie-crawler" ) { return 403; } # prevents nginx from returning 404s all the time along with good content try_files $uri $uri/ /blog/index.php; # also works, may be slower? # if (!-e $request_filename) { # rewrite ^/blog/(.+)$ /blog/index.php?q=$1 last; # } # cave yahoo group # "^/i/([a-z0-9_\-]+)/([a-z0-9_\-]+)/([a-z0-9_\-]+)?$" => "/cave/link.php?m=$1&g=$2&s=$3", rewrite ^/i/([a-z0-9_\-]+)/([a-z0-9_\-]+)/([a-z0-9_\-]+)?$ /cave/link.php?m=$1&g=$2&s=$3 permanent; # convert old blog url format to new. old had post id, new only has slug # "^(/blog/[a-z0-9_\-]+)/[0-9]+$" => "$1", rewrite ^(/blog/[a-z0-9_\-]+)/[0-9]+$ $1 permanent; # fix broken link errors. /blog/k_karma_29/family.html => /blog/k_family # "^/blog/k_[a-z0-9_\-]+/([a-z0-9_\-]+)\.html+$" => "/blog/k_$1", rewrite ^/blog/k_[a-z0-9_\-]+/([a-z0-9_\-]+)\.html+$ /blog/k_$1 permanent; # /blog/tag/new-world-order/topic.html # "^/blog/tag/[a-z0-9_\-]+/([a-z0-9_\-]+)\.html+$" => "/blog/k_$1", rewrite ^/blog/tag/[a-z0-9_\-]+/([a-z0-9_\-]+)\.html+$ /blog/k_$1 permanent; # redirect old archive html pages to blog pages # "^/archive/topic/([a-z0-9_\-]+)\.html+$" => "/blog/k_$1", rewrite ^/archive/topic/([a-z0-9_\-]+)\.html+$ /blog/k_$1 permanent; # fix bug where topic lines in keyword pages got linked as http://www.cosmicchannelings.com/blog/heaven.html # "^/blog/([a-z0-9_\-]+)\.html+$" => "/blog/k_$1" rewrite ^/blog/([a-z0-9_\-]+)\.html+$ /blog/k_$1 permanent; # redirect server error pages to the static page /50x.html # #error_page 500 502 503 504 /50x.html; #location = /50x.html { # root /var/www/nginx-default; #} # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { #proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ .php$ { fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_pass backend; fastcgi_index index.php; #fastcgi_param SCRIPT_FILENAME /var/www/cosmic$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_intercept_errors on; fastcgi_ignore_client_abort off; fastcgi_connect_timeout 60; fastcgi_send_timeout 180; fastcgi_read_timeout 180; #fastcgi_buffer_size 128k; #fastcgi_buffers 4 256k; # from http://forum.nginx.org/read.php?3,70566 fastcgi_buffers 256 16k; fastcgi_buffer_size 32k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\.ht { deny all; } } upstream backend { server 127.0.0.1:9000; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199359,199603#msg-199603 From nginx-forum at nginx.us Sat May 21 00:02:07 2011 From: nginx-forum at nginx.us (ltss) Date: Fri, 20 May 2011 16:02:07 -0400 Subject: Rewrite rule for nginx from Apache In-Reply-To: References: Message-ID: <6856e4d76e54e6ffbc66eaa7c05442ce.NginxMailingListEnglish@forum.nginx.org> thx i gonna to try it tommorow ;) the system is used for subdomain with a wildcard, example toto.domain.com show a mini website for toto and same things for 300 other users, the website is the same but the content depend of the name of the subdomain, all is stored in mysql for images and such ... sorry for my english ... Posted at Nginx Forum: http://forum.nginx.org/read.php?2,23868,199607#msg-199607 From mdounin at mdounin.ru Sat May 21 12:51:17 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sat, 21 May 2011 12:51:17 +0400 Subject: Randomly stopping large file downloads? In-Reply-To: <908b73582b85537775efe9c692b948c5.NginxMailingListEnglish@forum.nginx.org> References: <20110520102056.GG42265@mdounin.ru> <908b73582b85537775efe9c692b948c5.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110521085116.GM42265@mdounin.ru> Hello! On Fri, May 20, 2011 at 03:43:53PM -0400, nickn wrote: > Hi Maxim, thanks for your help. > I'm not using a proxy, it's just a straight connection to nginx. > > I ran it again with error log on info and found that it thinks the > client is timing out, although watching firefox it seemed to be > downloading ok the entire time and I wasn't having connectivity issues > on other sites. > > I tried keepalive_timeout 65; rather than 5 but had the same problem. > > Here's the info below, any ideas what it could be? Timeout to tune is send_timeout, not keepalive one. Anyway, please provide debug log and tcpdump of the connection in question. [...] > root at 217948:/var/log/nginx# nginx -V > nginx version: nginx/0.7.65 Note that 0.7.65 is rather old. You may want to upgrade to 1.0.2. [...] > sendfile on; When using sendfile with big files it's good idea to use something like sendfile_max_chunk 1m; as well. [...] > include /etc/nginx/conf.d/*.conf; > include /etc/nginx/sites-enabled/*; If there are any files here except the one you already showed - you may want to show them as well (or at least parts which may affect server{} in question). Maxim Dounin From nginx-forum at nginx.us Sat May 21 18:09:17 2011 From: nginx-forum at nginx.us (myckeul) Date: Sat, 21 May 2011 10:09:17 -0400 Subject: Proxy_pass and slash witch nginx In-Reply-To: <20110520110658.GA95649@sysoev.ru> References: <20110520110658.GA95649@sysoev.ru> Message-ID: <7cc085f85985df209205af97d16729d4.NginxMailingListEnglish@forum.nginx.org> hello ;) thank you, everything is ok now have a nice day Posted at Nginx Forum: http://forum.nginx.org/read.php?2,198964,199488#msg-199488 From adam at lionite.com Sun May 22 04:41:59 2011 From: adam at lionite.com (Adam Benayoun) Date: Sun, 22 May 2011 03:41:59 +0300 Subject: simple rewrite rules Message-ID: Hello everyone, I'm trying to setup some basic rewrite rules in nginx (I'm sorry if I may be asking obvious question but I moved my servers from apache to nginx and I can't figure out how to write simple rewrite rules in nginx). This is what I am trying to achieve: I have a URL with the following arguments: http://www.domain.com/browse/category What I want to achieve is: - When someone try to reach http://www.domain.com/category - it will serve the url http://www.domain.com/browse/category internally (no 301 redirect). - When someone will try to reach http://www.domain.com/browse/category it will redirect externally (301) to http://www.domain.com/category I've added 2 rewriterule at first but somehow only the first rule works, the second won't work: rewrite ^/browse/(.*) http://www.domain.com/$1 permanent; rewrite ^/(category1|category2|category3|category4)$ /browse/$1 last; Thanks (and sorry for asking a somewhat newbie question!) p.s: yes, I've read this http://wiki.nginx.org/HttpRewriteModule -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sun May 22 08:35:07 2011 From: nginx-forum at nginx.us (yaz) Date: Sun, 22 May 2011 00:35:07 -0400 Subject: My first rewrite QUERY_STRING Message-ID: Hello here is a piece of htaccess i am stuck converting into nginx rewrite conventions : RewriteCond %{QUERY_STRING} ^sms_ss= [OR] RewriteCond %{QUERY_STRING} ^scvds= RewriteRule ^(.*)$ http://www.mysite.com/$1? [R=301,L] I am trying something like if ($args ~ "sms_ss= (.*)") { rewrite ^ /(.*)=$args? break; } Not working Any advice would be appreciated thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199820,199820#msg-199820 From igor at sysoev.ru Sun May 22 09:21:56 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Sun, 22 May 2011 09:21:56 +0400 Subject: simple rewrite rules In-Reply-To: References: Message-ID: <20110522052155.GB65681@sysoev.ru> On Sun, May 22, 2011 at 03:41:59AM +0300, Adam Benayoun wrote: > Hello everyone, > I'm trying to setup some basic rewrite rules in nginx (I'm sorry if I may be > asking obvious question but I moved my servers from apache to nginx and I > can't figure out how to write simple rewrite rules in nginx). > > This is what I am trying to achieve: > > I have a URL with the following arguments: > > http://www.domain.com/browse/category > > What I want to achieve is: > - When someone try to reach http://www.domain.com/category - it will serve > the url http://www.domain.com/browse/category internally (no 301 redirect). > - When someone will try to reach http://www.domain.com/browse/category it > will redirect externally (301) to http://www.domain.com/category > > I've added 2 rewriterule at first but somehow only the first rule works, the > second won't work: > > rewrite ^/browse/(.*) http://www.domain.com/$1 permanent; > rewrite ^/(category1|category2|category3|category4)$ /browse/$1 > last; > > Thanks (and sorry for asking a somewhat newbie question!) > > p.s: yes, I've read this http://wiki.nginx.org/HttpRewriteModule You should not read anyting about rewrite module. It's better to forget about it. You should think using locations. location /category1/ #depending on processing method: # FastCGI fastcgi_pass backend; fatscgi_param SCRIPT_FILENMAE /path/to/browse; # proxying proxy_pass http://backend/browse/ # static files root /path/to/browse; } location /browse/ { rewrite ^/browse/(.*) /$1 permanent; } -- Igor Sysoev From igor at sysoev.ru Sun May 22 09:24:04 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Sun, 22 May 2011 09:24:04 +0400 Subject: My first rewrite QUERY_STRING In-Reply-To: References: Message-ID: <20110522052404.GC65681@sysoev.ru> On Sun, May 22, 2011 at 12:35:07AM -0400, yaz wrote: > Hello > > here is a piece of htaccess i am stuck converting into nginx rewrite > conventions : > > RewriteCond %{QUERY_STRING} ^sms_ss= [OR] > RewriteCond %{QUERY_STRING} ^scvds= > RewriteRule ^(.*)$ http://www.mysite.com/$1? [R=301,L] > > > I am trying something like > > if ($args ~ "sms_ss= (.*)") { > rewrite ^ /(.*)=$args? break; > } > > Not working if ($arg_ss) { rewrite ^ $uri? permanent;; } if ($arg_scvds) { rewrite ^ $uri? permanent;; } -- Igor Sysoev From nginx-forum at nginx.us Sun May 22 09:57:41 2011 From: nginx-forum at nginx.us (yaz) Date: Sun, 22 May 2011 01:57:41 -0400 Subject: My first rewrite QUERY_STRING In-Reply-To: References: Message-ID: <227bf7a88a8554edb8150998b1b6c09d.NginxMailingListEnglish@forum.nginx.org> thanks igor, this is working. I will read the doc for better understanding of rewriting with nginx Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199820,199832#msg-199832 From adam at lionite.com Sun May 22 11:50:51 2011 From: adam at lionite.com (Adam Benayoun) Date: Sun, 22 May 2011 10:50:51 +0300 Subject: simple rewrite rules In-Reply-To: <20110522052155.GB65681@sysoev.ru> References: <20110522052155.GB65681@sysoev.ru> Message-ID: Igor, Thanks for the pointer however there is one last thing I'm not sure how to do. Basically my application is built on top of a framework meaning that everything should go through index.php and then the routers configured appropriately should serve you different templates and controllers based on the REQUEST_URI. Basically when I try to access http://www.domain.com/category - it should pass to index.php the request_uri /browse/category and then serve the appropriate output. This is how my config look like, let me know if that make sense and what should I add to mimic that request_uri through index.php Cheers, server { listen *:80; server_name www.domain.com; access_log /var/www/domain/logs/access_log main; error_log /var/www/domain/logs/error_log debug; root /var/www/domain/html/http; index index.php; if ($http_host !~ "^www\.domain\.com$") { rewrite ^(.*) http://www.domain.com$1 permanent; } location / { try_files $uri $uri/ /index.php?$args; } location /browse { #rewrite ^/browse/(.*) http://www.domain.com/$1 permanent; } location /min { try_files $uri $uri/ /min/index.php?q=; } location /blog { try_files $uri $uri/ /blog/index.php?q=$1; } location /apc { try_files $uri $uri/ /apc.php$args; } location ~ \.php { include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param SERVER_NAME $http_host; fastcgi_pass 127.0.0.1:9000; } location ~* ^.+\.(ht|svn)$ { deny all; } # Static files location location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$ { expires max; } } On Sun, May 22, 2011 at 08:21, Igor Sysoev wrote: > On Sun, May 22, 2011 at 03:41:59AM +0300, Adam Benayoun wrote: > > Hello everyone, > > I'm trying to setup some basic rewrite rules in nginx (I'm sorry if I may > be > > asking obvious question but I moved my servers from apache to nginx and I > > can't figure out how to write simple rewrite rules in nginx). > > > > This is what I am trying to achieve: > > > > I have a URL with the following arguments: > > > > http://www.domain.com/browse/category > > > > What I want to achieve is: > > - When someone try to reach http://www.domain.com/category - it will > serve > > the url http://www.domain.com/browse/category internally (no 301 > redirect). > > - When someone will try to reach http://www.domain.com/browse/categoryit > > will redirect externally (301) to http://www.domain.com/category > > > > I've added 2 rewriterule at first but somehow only the first rule works, > the > > second won't work: > > > > rewrite ^/browse/(.*) http://www.domain.com/$1 permanent; > > rewrite ^/(category1|category2|category3|category4)$ > /browse/$1 > > last; > > > > Thanks (and sorry for asking a somewhat newbie question!) > > > > p.s: yes, I've read this http://wiki.nginx.org/HttpRewriteModule > > You should not read anyting about rewrite module. It's better to forget > about it. You should think using locations. > > location /category1/ > #depending on processing method: > > # FastCGI > fastcgi_pass backend; > fatscgi_param SCRIPT_FILENMAE /path/to/browse; > > # proxying > proxy_pass http://backend/browse/ > > # static files > root /path/to/browse; > } > > location /browse/ { > rewrite ^/browse/(.*) /$1 permanent; > } > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sun May 22 18:56:51 2011 From: nginx-forum at nginx.us (benseb) Date: Sun, 22 May 2011 10:56:51 -0400 Subject: Sanity check of my config - is it secure? Message-ID: <3ce420be0701a81ea969389d395b6a49.NginxMailingListEnglish@forum.nginx.org> Hi We had Nginx setup on a domain serving static content (images[0-9].domain.com). Recently we've made our main domain also use the same Nginx installation and proxy any php requests to Apache. All is working fine. We've set it to serve all static content from our images.domain.com domains, and it will also catch any static content served from the main www.domain.com as well, before finally passing any dynamic php requests through to Apache. What I want to check is that there are no problems with the configuration that would let someone view the source of our PHP pages or access restricted 'admin' directories, etc. I've not configured NGinx before so would appreciate some help checking my config? user www; worker_processes 6; error_log /var/log/nginx-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; #access_log logs/access.log main; sendfile on; #tcp_nopush on; ## Timeouts client_body_timeout 10; client_header_timeout 10; keepalive_timeout 5 5; send_timeout 10; gzip on; # gzip_static on; gzip_comp_level 5; gzip_http_version 1.0; gzip_min_length 1000; gzip_types text/plain text/css image/x-icon application/x-javascript; server{ listen 80 default_server; #all other hosts deny server_name _; return 444; } server { #IMAGES DOMAIN listen x.x.x.x:80; server_name images.x.com images1.x.com images2.x.com stat server_tokens off; gzip_comp_level 9; if ($request_method !~ ^(GET|HEAD)$ ) { return 444; } # Only serve these locations location ^~ /images/folder1/{ if ($request_uri ~* (^\/|\.ico|\.css|\.js|\.swf|\.gif|\.jp?g|\.png)$ ) { break; } root /home/vhosts/x.com/httpdocs; expires 7d; } location ^~ /images/folder2/{ root /home/vhosts/x.com/httpdocs; expires 7d; } location ^~/images/ { root /home/vhosts/x.com/httpdocs; } location ^~ /applets/{ root /home/vhosts/x.com/httpdocs; expires max; } location ^~ /css/{ root /home/vhosts/x.com/httpdocs; expires max; } location ~* \.(ico|css|js|swf|gif|jp?g|png)$ { root /home/vhosts/x.com/httpdocs; } location ~* \.(php|html){ return 444; #should not happen, but just incase } if ($host !~ ^(images.x.com|images1.x.com|images2.x.com)){ return 444; } location ^~/admin/ { deny all; } } server { #MAIN DOMAIN - REDIRECT TO www. listen x.x.x.x:80; server_name x.com; rewrite ^(.*) http://www.x.com$1 permanent; } server { #MAIN DOMAIN listen x.x.x.x:80; server_name www.x.com; #access_log /var/log/nginx.access.log; error_log /var/log/nginx.error.log; location /nginx_status { stub_status on; access_log off; allow x.x.x.x/24; deny all; } location ^~ /images/folder1/{ root /home/vhosts/x.com/httpdocs; expires 7d; } location ^~ /images/folder2/{ root /home/vhosts/x.com/httpdocs; expires 7d; } location ^~/images/ { root /home/vhosts/x.com/httpdocs; } location ^~ /applets/{ root /home/vhosts/x.com/httpdocs; expires max; } location ^~ /css/{ root /home/vhosts/x.com/httpdocs; expires max; } location ~* \.(ico|css|js|swf|gif|jp?g|png)$ { root /home/vhosts/x.com/httpdocs; #expires max; } location / { proxy_pass http://127.0.0.1:8080; #CACHING #proxy_cache my-cache; #proxy_cache_valid 200 302 1m; #proxy_cache_valid 404 1m; #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 200m; #max upload size client_body_buffer_size 128k; proxy_connect_timeout 900; proxy_send_timeout 900; proxy_read_timeout 900; #proxy_buffer_size 4k; #proxy_buffers 4 32k; #proxy_busy_buffers_size 64k; #proxy_temp_file_write_size 64k; } } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199902,199902#msg-199902 From nunomagalhaes at eu.ipp.pt Sun May 22 20:48:42 2011 From: nunomagalhaes at eu.ipp.pt (=?UTF-8?Q?Nuno_Magalh=C3=A3es?=) Date: Sun, 22 May 2011 17:48:42 +0100 Subject: Sanity check of my config - is it secure? In-Reply-To: <3ce420be0701a81ea969389d395b6a49.NginxMailingListEnglish@forum.nginx.org> References: <3ce420be0701a81ea969389d395b6a49.NginxMailingListEnglish@forum.nginx.org> Message-ID: Have a look at these: http://wiki.nginx.org/Configuration http://wiki.nginx.org/Modules http://wiki.nginx.org/3rdPartyModules https://calomel.org/nginx.html And what version of nginx (latest is 1.0.2)? What OS? On Sun, May 22, 2011 at 15:56, benseb wrote: > ? ?gzip ?on; > # ?gzip_static on; If you're serving so much static content you may as well enable gzip_static, although it's pointless for compressed images like jpg. > ? ?gzip_types ? ? ? ?text/plain text/css image/x-icon No html? Javascript? > ? ? ? ?server_tokens off; Won't disable the Server: header. There's a module that can do that. > ? ? ? ? if ($request_uri ~* > (^\/|\.ico|\.css|\.js|\.swf|\.gif|\.jp?g|\.png)$ ) { You can probably replace this if-statement with a regex. > ? ? ? ? location ^~ /applets/{ > ? ? ? ? ? ? ? root /home/vhosts/x.com/httpdocs; > ? ? ? ? ? ? ? expires max; > ? ? ? ?} > ? ? ? ?location ^~ /css/{ > ? ? ? ? ? ? ? root /home/vhosts/x.com/httpdocs; > ? ? ? ? ? ? ? expires max; > ? ? ? ?} And merge these locations (as well as others) perhaps? Something like ^~ /(applets|css)/ Just a few hints, like i said i'm no expert. -- Mars 2 Stay! http://xkcd.com/801/ /etc From nginx-forum at nginx.us Sun May 22 21:24:23 2011 From: nginx-forum at nginx.us (benseb) Date: Sun, 22 May 2011 13:24:23 -0400 Subject: Sanity check of my config - is it secure? In-Reply-To: References: Message-ID: <5542112b2862b2882ae3cbf516e14c16.NginxMailingListEnglish@forum.nginx.org> Thanks for those tips. I'll have a read around those bits My main concern is that by combining different locations, etc i may have accidentally exposed a security issue - I need to ensure everything that's not an image/css file/javascript file etc is either denied or proxied to apache. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199902,199931#msg-199931 From justin at specialbusservice.com Sun May 22 21:36:47 2011 From: justin at specialbusservice.com (Justin Cormack) Date: Sun, 22 May 2011 18:36:47 +0100 Subject: Sanity check of my config - is it secure? In-Reply-To: <5542112b2862b2882ae3cbf516e14c16.NginxMailingListEnglish@forum.nginx.org> References: <5542112b2862b2882ae3cbf516e14c16.NginxMailingListEnglish@forum.nginx.org> Message-ID: <1306085807.3761.36.camel@mackerel> On Sun, 2011-05-22 at 13:24 -0400, benseb wrote: > Thanks for those tips. I'll have a read around those bits > > My main concern is that by combining different locations, etc i may have > accidentally exposed a security issue - I need to ensure everything > that's not an image/css file/javascript file etc is either denied or > proxied to apache. You should write some tests! It is much better to use some well thought out tests in addition to studying the config. Justin From nginx-forum at nginx.us Sun May 22 22:37:46 2011 From: nginx-forum at nginx.us (benseb) Date: Sun, 22 May 2011 14:37:46 -0400 Subject: Sanity check of my config - is it secure? In-Reply-To: <1306085807.3761.36.camel@mackerel> References: <1306085807.3761.36.camel@mackerel> Message-ID: For our static subdomain (which should only serve static content) I'd like to add a whitelist of content - so if the filename doesn't match jpg/png/gif/css/js etc it will return a 444 What's the correct syntax to do this: location !~* \.(?:ico|css|js|gif|jpe?g|png)$ { #dont serve any other files return 444; } The above doesnt work as !~* isn't allowed. What the best way to say "not one of the following extensions". All the examples in the documenation are the opposite? Cheers Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199902,199950#msg-199950 From nginx-forum at nginx.us Sun May 22 23:38:43 2011 From: nginx-forum at nginx.us (M.A.G) Date: Sun, 22 May 2011 15:38:43 -0400 Subject: Nginx Vs Nginx Performance [Versions Battle] Message-ID: Hi All, I would like to know if it's makes any difference in term of using Nginx versions. Did anyone had any experience with that? Did anyone do any benchmarks about that? Looking for answers Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199956,199956#msg-199956 From sgsfak at gmail.com Mon May 23 01:20:55 2011 From: sgsfak at gmail.com (Stelianos G. Sfakianakis) Date: Mon, 23 May 2011 00:20:55 +0300 Subject: another rewrite/try files issue Message-ID: Hello, I am having the following problem: - I want to have a "virtual" url e.g. "/myapp" to have a totally different document root e.g. "/home/stelios/myapp" (instead of the default '/var/www') - locations of the type "/myapp/css/print.css" should respond with the specific file at the "/home/stelios/myapp" root (i.e. with "/home/stelios/myapp/css/print.css" - if the the file requested does not exist, then the "index.php" should be called via FastCGI with args "?u=$uri" (e.g. "/myapp/users/12" should be rewritten to "/home/stelios/myapp/index.php?u=users/12") I have tried the following: location ~ /myapp/(.*) { root /home/stelios/myapp; try_files /$1 /$1/ /index.php?u=$1; } # and the "default" PHP/FastCGI location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } but it seems that it doesn't work for the non files. In particular it seems that after the internal redirect to index.php, the root is overwritten and instead of calling my /home/stelios/myapp/index.php the one at the default root ("/var/www/index.php") is beeing called. Do you know what's wrong? And possibl another way to achieve what I want? Thank you very much in advance! P.S. I am using nginx-0.8.4 on Ubuntu St. From nginx-forum at nginx.us Mon May 23 02:06:01 2011 From: nginx-forum at nginx.us (brianmercer) Date: Sun, 22 May 2011 18:06:01 -0400 Subject: another rewrite/try files issue In-Reply-To: References: Message-ID: Stelianos G. Sfakianakis Wrote: ------------------------------------------------------- > Hello, > > I am having the following problem: > > - I want to have a "virtual" url e.g. "/myapp" to > have a totally > different document root e.g. "/home/stelios/myapp" > (instead of the > default '/var/www') > - locations of the type "/myapp/css/print.css" > should respond with > the specific file at the "/home/stelios/myapp" > root (i.e. with > "/home/stelios/myapp/css/print.css" > - if the the file requested does not exist, then > the "index.php" > should be called via FastCGI with args "?u=$uri" > (e.g. > "/myapp/users/12" should be rewritten to > "/home/stelios/myapp/index.php?u=users/12") > > I have tried the following: > > location ~ /myapp/(.*) { > root /home/stelios/myapp; > try_files /$1 /$1/ > /index.php?u=$1; > } > # and the "default" PHP/FastCGI > location ~ \.php$ { > fastcgi_pass 127.0.0.1:9000; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME > $document_root$fastcgi_script_name; > include fastcgi_params; > } > > > but it seems that it doesn't work for the non > files. In particular it > seems that after the internal redirect to > index.php, the root is > overwritten and instead of calling my > /home/stelios/myapp/index.php > the one at the default root ("/var/www/index.php") > is beeing called. > > Do you know what's wrong? And possibl another way > to achieve what I want? > > Thank you very much in advance! > > P.S. I am using nginx-0.8.4 on Ubuntu > > St. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx Possibly this: location /myapp/ { root /home/stelios; try_files $uri @fallback; } # and the "default" PHP/FastCGI location @fallback { fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME /home/stelios/myapp/index.php; include fastcgi_params; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199965,199970#msg-199970 From nginx-forum at nginx.us Mon May 23 04:31:59 2011 From: nginx-forum at nginx.us (ltss) Date: Sun, 22 May 2011 20:31:59 -0400 Subject: Rewrite rule for nginx from Apache In-Reply-To: <6856e4d76e54e6ffbc66eaa7c05442ce.NginxMailingListEnglish@forum.nginx.org> References: <6856e4d76e54e6ffbc66eaa7c05442ce.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4afe9fa1984e2ca74c7636d2a379d417.NginxMailingListEnglish@forum.nginx.org> Thanks that work really fine ;) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,23868,199984#msg-199984 From sgsfak at gmail.com Mon May 23 10:53:08 2011 From: sgsfak at gmail.com (Stelios Sfakianakis) Date: Mon, 23 May 2011 09:53:08 +0300 Subject: another rewrite/try files issue In-Reply-To: References: Message-ID: <4DDA0454.5080101@gmail.com> On 23/5/2011 1:06 ??, brianmercer wrote: > Possibly this: > > location /myapp/ { > root /home/stelios; > try_files $uri @fallback; > } > > # and the "default" PHP/FastCGI > location @fallback { > fastcgi_pass 127.0.0.1:9000; > fastcgi_param SCRIPT_FILENAME /home/stelios/myapp/index.php; > include fastcgi_params; > } > Thanks Brian, that *almost* works (although I don't like repeating [most of] the fastcgi config..) But I also need to pass *part* of the original path as a query string. I tried to following : location @fallback { fastcgi_pass 127.0.0.1:9000; include fastcgi_params; fastcgi_param SCRIPT_FILENAME /home/stelios/myapp/index.php; fastcgi_param QUERY_STRING u=$uri&$args; } which works but now for the url ".../myapp/users" the script gets a query string like this: "u=/myapp/users" whereas I want it to be "u=/users" (i.e. remove the "base" path). Is there any simple solution to that? (e.g. can we pass parameters to a named location?) Thanks! Stelios From agentzh at gmail.com Mon May 23 12:46:32 2011 From: agentzh at gmail.com (agentzh) Date: Mon, 23 May 2011 16:46:32 +0800 Subject: lua location capture In-Reply-To: References: Message-ID: On Fri, May 20, 2011 at 7:32 PM, Richard Kearsley wrote: > I traced the issue with the header's not being re-sent > > ngx.location.capture("/some-location", { method = ngx.HTTP_HEAD }) > they are not re-sent > > but > ngx.location.capture("/some-location", { method = ngx.HTTP_GET }) > they are sent > > I don't know if this is correct behavior (it may well be) > I got around it by changing the headers I needed into args then re-creating them at /some-location :( > This issue has been proven to be caused by two separate bugs. I've already fixed them in ngx_lua's master branch: http://bit.ly/mU1Z29 Could you please try it out? Best, -agentzh From roberto at unbit.it Mon May 23 18:18:30 2011 From: roberto at unbit.it (Roberto De Ioris) Date: Mon, 23 May 2011 16:18:30 +0200 (CEST) Subject: [PATH] support for UNIX socket in abstract namespace Message-ID: <9bdc098f7db74f8cfdc102938169f26a.squirrel@manage.unbit.it> (Warning this is Linux only) Hi all, the attached path adds support for unix socket in abstract namespace. They are special sockets without filesystem correspondence (so you can use them without thinking about permissions or in chroot). In netstat they are reported with a '@' prefix. For example (using uWSGI): uwsgi -s @funnysock netstat -l unix 2 [ ACC ] STREAM LISTENING 23813 @funnysock After applying the patch you can connect to it with uwsgi_pass unix:@funnysock; I hope it can be useful -- Roberto De Ioris http://unbit.it -------------- next part -------------- A non-text attachment was scrubbed... Name: unix_abstract.patch Type: application/octet-stream Size: 1049 bytes Desc: not available URL: From david at styleflare.com Mon May 23 20:13:27 2011 From: david at styleflare.com (David J.) Date: Mon, 23 May 2011 12:13:27 -0400 Subject: Basic Auth - MySQL/PgSQL Backend. Message-ID: <4DDA87A7.8020200@styleflare.com> I was wondering what options are available for using BasicAuth using Either MySQL or PostGres backend to store users. From igor at sysoev.ru Mon May 23 20:35:41 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Mon, 23 May 2011 20:35:41 +0400 Subject: [PATH] support for UNIX socket in abstract namespace In-Reply-To: <9bdc098f7db74f8cfdc102938169f26a.squirrel@manage.unbit.it> References: <9bdc098f7db74f8cfdc102938169f26a.squirrel@manage.unbit.it> Message-ID: <20110523163541.GA39527@sysoev.ru> On Mon, May 23, 2011 at 04:18:30PM +0200, Roberto De Ioris wrote: > (Warning this is Linux only) > > Hi all, the attached path adds support for unix socket in abstract namespace. > They are special sockets without filesystem correspondence (so you can use > them without thinking about permissions or in chroot). In netstat they are > reported with a '@' prefix. > > For example (using uWSGI): > > uwsgi -s @funnysock > > netstat -l > > unix 2 [ ACC ] STREAM LISTENING 23813 @funnysock > > After applying the patch you can connect to it with > > uwsgi_pass unix:@funnysock; > > I hope it can be useful Thank you for the feature. I think it's better to allow nginx configuration parser to support "\0" as binary 0. Then this socket may be set as uwsgi_pass unix:\0funnysock; -- Igor Sysoev From piotr.sikora at frickle.com Mon May 23 20:49:37 2011 From: piotr.sikora at frickle.com (Piotr Sikora) Date: Mon, 23 May 2011 18:49:37 +0200 Subject: Basic Auth - MySQL/PgSQL Backend. In-Reply-To: <4DDA87A7.8020200@styleflare.com> References: <4DDA87A7.8020200@styleflare.com> Message-ID: <07C71B337A6E42D8AB32D3578CD2CE03@Desktop> Hi, > I was wondering what options are available for using BasicAuth using > Either MySQL or PostGres backend to store users. You can do this with ngx_http_auth_request [1] with either ngx_drizzle [2] (for Drizzle/MariaDB/MySQL/Percona) or ngx_postgres [3] (for PostgreSQL). Working example for ngx_postgres is available in its README (Sample configuration #4). [1] http://mdounin.ru/hg/ngx_http_auth_request_module/ [2] https://github.com/chaoslawful/drizzle-nginx-module [3] https://github.com/FRiCKLE/ngx_postgres Best regards, Piotr Sikora < piotr.sikora at frickle.com > From david at styleflare.com Mon May 23 20:55:38 2011 From: david at styleflare.com (David J.) Date: Mon, 23 May 2011 12:55:38 -0400 Subject: Basic Auth - MySQL/PgSQL Backend. In-Reply-To: <07C71B337A6E42D8AB32D3578CD2CE03@Desktop> References: <4DDA87A7.8020200@styleflare.com> <07C71B337A6E42D8AB32D3578CD2CE03@Desktop> Message-ID: <4DDA918A.3010701@styleflare.com> Thanks. I didnt see the example in the README? Sample #4? Thanks Again. David. On 5/23/11 12:49 PM, Piotr Sikora wrote: > Hi, > >> I was wondering what options are available for using BasicAuth using >> Either MySQL or PostGres backend to store users. > > You can do this with ngx_http_auth_request [1] with either ngx_drizzle > [2] (for Drizzle/MariaDB/MySQL/Percona) or ngx_postgres [3] (for > PostgreSQL). > > Working example for ngx_postgres is available in its README (Sample > configuration #4). > > [1] http://mdounin.ru/hg/ngx_http_auth_request_module/ > [2] https://github.com/chaoslawful/drizzle-nginx-module > [3] https://github.com/FRiCKLE/ngx_postgres > > Best regards, > Piotr Sikora < piotr.sikora at frickle.com > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > From piotr.sikora at frickle.com Mon May 23 21:06:04 2011 From: piotr.sikora at frickle.com (Piotr Sikora) Date: Mon, 23 May 2011 19:06:04 +0200 Subject: Basic Auth - MySQL/PgSQL Backend. In-Reply-To: <4DDA918A.3010701@styleflare.com> References: <4DDA87A7.8020200@styleflare.com><07C71B337A6E42D8AB32D3578CD2CE03@Desktop> <4DDA918A.3010701@styleflare.com> Message-ID: <31FCBEFC2F9641ED9451C2CBE0120518@Desktop> Hi, > I didnt see the example in the README? > Sample #4? Then look again, it's there. Best regards, Piotr Sikora < piotr.sikora at frickle.com > From david at styleflare.com Mon May 23 21:09:36 2011 From: david at styleflare.com (David J.) Date: Mon, 23 May 2011 13:09:36 -0400 Subject: Basic Auth - MySQL/PgSQL Backend. In-Reply-To: <31FCBEFC2F9641ED9451C2CBE0120518@Desktop> References: <4DDA87A7.8020200@styleflare.com><07C71B337A6E42D8AB32D3578CD2CE03@Desktop> <4DDA918A.3010701@styleflare.com> <31FCBEFC2F9641ED9451C2CBE0120518@Desktop> Message-ID: <4DDA94D0.5080908@styleflare.com> I am not sure which readme you are referring to; I see your name is listed here; https://github.com/chaoslawful/drizzle-nginx-module Is this the file you are talking about? Thanks. On 5/23/11 1:06 PM, Piotr Sikora wrote: > Hi, > >> I didnt see the example in the README? >> Sample #4? > > Then look again, it's there. > > Best regards, > Piotr Sikora < piotr.sikora at frickle.com > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > From nginx-forum at nginx.us Mon May 23 21:18:30 2011 From: nginx-forum at nginx.us (the_traveller) Date: Mon, 23 May 2011 13:18:30 -0400 Subject: Rewrite rule for nginx from Apache In-Reply-To: <4afe9fa1984e2ca74c7636d2a379d417.NginxMailingListEnglish@forum.nginx.org> References: <6856e4d76e54e6ffbc66eaa7c05442ce.NginxMailingListEnglish@forum.nginx.org> <4afe9fa1984e2ca74c7636d2a379d417.NginxMailingListEnglish@forum.nginx.org> Message-ID: Hi mr Igor I'm sory coz i toke alittle bit too long so if i have to make any ngnix rule i have to make it like that by ex: location /Joke/ { fastcgi_pass ... fastcgi_param SCRIPT_FILENAME /jokes.php; fastcgi_param QUERY_STRING $args; ... } and the Original Apache rule is RewriteRule ^Joke/.* jokes.php [QSA] sposing that the script is in the public dir of the ftp is my try right?? and also is the three dots in the second line fastcgi_pass ... and before the closing tag ... } is this is right or i have to remove them ?? thanks alot for ur help and if i have removed them Posted at Nginx Forum: http://forum.nginx.org/read.php?2,23868,200161#msg-200161 From piotr.sikora at frickle.com Mon May 23 21:19:25 2011 From: piotr.sikora at frickle.com (Piotr Sikora) Date: Mon, 23 May 2011 19:19:25 +0200 Subject: Basic Auth - MySQL/PgSQL Backend. In-Reply-To: <4DDA94D0.5080908@styleflare.com> References: <4DDA87A7.8020200@styleflare.com><07C71B337A6E42D8AB32D3578CD2CE03@Desktop> <4DDA918A.3010701@styleflare.com><31FCBEFC2F9641ED9451C2CBE0120518@Desktop> <4DDA94D0.5080908@styleflare.com> Message-ID: <3FB95AA462DD4243BE9671D18CA04BCE@Desktop> Hi, > I am not sure which readme you are referring to; "Working example for ngx_postgres is available in its README (Sample configuration #4)." should be self-explanatory ;) > I see your name is listed here; > > https://github.com/chaoslawful/drizzle-nginx-module I'm listed in the other one as well. > Is this the file you are talking about? Nope, I'm talking about ngx_postgres's one. Best regards, Piotr Sikora < piotr.sikora at frickle.com > From david at styleflare.com Mon May 23 21:22:16 2011 From: david at styleflare.com (David J.) Date: Mon, 23 May 2011 13:22:16 -0400 Subject: Basic Auth - MySQL/PgSQL Backend. In-Reply-To: <3FB95AA462DD4243BE9671D18CA04BCE@Desktop> References: <4DDA87A7.8020200@styleflare.com><07C71B337A6E42D8AB32D3578CD2CE03@Desktop> <4DDA918A.3010701@styleflare.com><31FCBEFC2F9641ED9451C2CBE0120518@Desktop> <4DDA94D0.5080908@styleflare.com> <3FB95AA462DD4243BE9671D18CA04BCE@Desktop> Message-ID: <4DDA97C8.3030601@styleflare.com> Thanks. I really appreciate it; That (surprisingly!) was the only one I didnt look at. Thanks again. On 5/23/11 1:19 PM, Piotr Sikora wrote: > Hi, > >> I am not sure which readme you are referring to; > > "Working example for ngx_postgres is available in its README (Sample > configuration #4)." should be self-explanatory ;) > >> I see your name is listed here; >> >> https://github.com/chaoslawful/drizzle-nginx-module > > I'm listed in the other one as well. > >> Is this the file you are talking about? > > Nope, I'm talking about ngx_postgres's one. > > Best regards, > Piotr Sikora < piotr.sikora at frickle.com > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > From roberto at unbit.it Mon May 23 21:42:02 2011 From: roberto at unbit.it (Roberto De Ioris) Date: Mon, 23 May 2011 19:42:02 +0200 (CEST) Subject: [PATH] support for UNIX socket in abstract namespace In-Reply-To: <20110523163541.GA39527@sysoev.ru> References: <9bdc098f7db74f8cfdc102938169f26a.squirrel@manage.unbit.it> <20110523163541.GA39527@sysoev.ru> Message-ID: <45113c3f74b15ed88b9bdeff9a2e7a20.squirrel@manage.unbit.it> > On Mon, May 23, 2011 at 04:18:30PM +0200, Roberto De Ioris wrote: >> (Warning this is Linux only) >> >> Hi all, the attached path adds support for unix socket in abstract >> namespace. >> They are special sockets without filesystem correspondence (so you can >> use >> them without thinking about permissions or in chroot). In netstat they >> are >> reported with a '@' prefix. >> >> For example (using uWSGI): >> >> uwsgi -s @funnysock >> >> netstat -l >> >> unix 2 [ ACC ] STREAM LISTENING 23813 @funnysock >> >> After applying the patch you can connect to it with >> >> uwsgi_pass unix:@funnysock; >> >> I hope it can be useful > > Thank you for the feature. I think it's better to allow nginx > configuration > parser to support "\0" as binary 0. Then this socket may be set as > > uwsgi_pass unix:\0funnysock; > I fear it will require changes changes as 0 being the token delimeter in config parsing :( -- Roberto De Ioris http://unbit.it From roberto at unbit.it Mon May 23 21:44:06 2011 From: roberto at unbit.it (Roberto De Ioris) Date: Mon, 23 May 2011 19:44:06 +0200 (CEST) Subject: [PATH] support for UNIX socket in abstract namespace In-Reply-To: <45113c3f74b15ed88b9bdeff9a2e7a20.squirrel@manage.unbit.it> References: <9bdc098f7db74f8cfdc102938169f26a.squirrel@manage.unbit.it> <20110523163541.GA39527@sysoev.ru> <45113c3f74b15ed88b9bdeff9a2e7a20.squirrel@manage.unbit.it> Message-ID: <034aea7b75fecac7c87e6d9e229f6ad0.squirrel@manage.unbit.it> >>> I hope it can be useful >> >> Thank you for the feature. I think it's better to allow nginx >> configuration >> parser to support "\0" as binary 0. Then this socket may be set as >> >> uwsgi_pass unix:\0funnysock; >> > > I fear it will require changes changes i mean "heavy changes" -- Roberto De Ioris http://unbit.it From igor at sysoev.ru Mon May 23 21:48:56 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Mon, 23 May 2011 21:48:56 +0400 Subject: [PATH] support for UNIX socket in abstract namespace In-Reply-To: <45113c3f74b15ed88b9bdeff9a2e7a20.squirrel@manage.unbit.it> References: <9bdc098f7db74f8cfdc102938169f26a.squirrel@manage.unbit.it> <20110523163541.GA39527@sysoev.ru> <45113c3f74b15ed88b9bdeff9a2e7a20.squirrel@manage.unbit.it> Message-ID: <20110523174856.GC39527@sysoev.ru> On Mon, May 23, 2011 at 07:42:02PM +0200, Roberto De Ioris wrote: > > > On Mon, May 23, 2011 at 04:18:30PM +0200, Roberto De Ioris wrote: > >> (Warning this is Linux only) > >> > >> Hi all, the attached path adds support for unix socket in abstract > >> namespace. > >> They are special sockets without filesystem correspondence (so you can > >> use > >> them without thinking about permissions or in chroot). In netstat they > >> are > >> reported with a '@' prefix. > >> > >> For example (using uWSGI): > >> > >> uwsgi -s @funnysock > >> > >> netstat -l > >> > >> unix 2 [ ACC ] STREAM LISTENING 23813 @funnysock > >> > >> After applying the patch you can connect to it with > >> > >> uwsgi_pass unix:@funnysock; > >> > >> I hope it can be useful > > > > Thank you for the feature. I think it's better to allow nginx > > configuration > > parser to support "\0" as binary 0. Then this socket may be set as > > > > uwsgi_pass unix:\0funnysock; > > > > I fear it will require changes changes as 0 being the token delimeter in > config parsing :( No, nginx does not use zero-trailing strings. -- Igor Sysoev From igor at sysoev.ru Mon May 23 21:51:51 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Mon, 23 May 2011 21:51:51 +0400 Subject: [PATH] support for UNIX socket in abstract namespace In-Reply-To: <45113c3f74b15ed88b9bdeff9a2e7a20.squirrel@manage.unbit.it> References: <9bdc098f7db74f8cfdc102938169f26a.squirrel@manage.unbit.it> <20110523163541.GA39527@sysoev.ru> <45113c3f74b15ed88b9bdeff9a2e7a20.squirrel@manage.unbit.it> Message-ID: <20110523175151.GD39527@sysoev.ru> On Mon, May 23, 2011 at 07:42:02PM +0200, Roberto De Ioris wrote: > > > On Mon, May 23, 2011 at 04:18:30PM +0200, Roberto De Ioris wrote: > >> (Warning this is Linux only) > >> > >> Hi all, the attached path adds support for unix socket in abstract > >> namespace. > >> They are special sockets without filesystem correspondence (so you can > >> use > >> them without thinking about permissions or in chroot). In netstat they > >> are > >> reported with a '@' prefix. > >> > >> For example (using uWSGI): > >> > >> uwsgi -s @funnysock > >> > >> netstat -l > >> > >> unix 2 [ ACC ] STREAM LISTENING 23813 @funnysock > >> > >> After applying the patch you can connect to it with > >> > >> uwsgi_pass unix:@funnysock; > >> > >> I hope it can be useful > > > > Thank you for the feature. I think it's better to allow nginx > > configuration > > parser to support "\0" as binary 0. Then this socket may be set as > > > > uwsgi_pass unix:\0funnysock; > > > > I fear it will require changes changes as 0 being the token delimeter in > config parsing :( Could you test the attached patch ? -- Igor Sysoev -------------- next part -------------- Index: src/core/ngx_conf_file.c =================================================================== --- src/core/ngx_conf_file.c (revision 3923) +++ src/core/ngx_conf_file.c (working copy) @@ -714,6 +714,11 @@ *dst++ = '\n'; src += 2; continue; + + case '0': + *dst++ = '\0'; + src += 2; + continue; } } From nginx-forum at nginx.us Mon May 23 22:02:43 2011 From: nginx-forum at nginx.us (brianmercer) Date: Mon, 23 May 2011 14:02:43 -0400 Subject: another rewrite/try files issue In-Reply-To: <4DDA0454.5080101@gmail.com> References: <4DDA0454.5080101@gmail.com> Message-ID: <64a6135089b22eb9bfcfafb93ef9ceba.NginxMailingListEnglish@forum.nginx.org> Stelios Sfakianakis Wrote: ------------------------------------------------------- > On 23/5/2011 1:06 ??, brianmercer wrote: > > Possibly this: > > > > location /myapp/ { > > root /home/stelios; > > try_files $uri @fallback; > > } > > > > # and the "default" PHP/FastCGI > > location @fallback { > > fastcgi_pass 127.0.0.1:9000; > > fastcgi_param SCRIPT_FILENAME > /home/stelios/myapp/index.php; > > include fastcgi_params; > > } > > > > Thanks Brian, that *almost* works (although I > don't like repeating [most > of] the fastcgi config..) > > But I also need to pass *part* of the original > path as a query string. I > tried to following : > > location @fallback { > fastcgi_pass 127.0.0.1:9000; > include fastcgi_params; > fastcgi_param SCRIPT_FILENAME > /home/stelios/myapp/index.php; > fastcgi_param QUERY_STRING u=$uri&$args; > } > > > which works but now for the url ".../myapp/users" > the script gets a > query string like this: "u=/myapp/users" whereas I > want it to be > "u=/users" (i.e. remove the "base" path). Is there > any simple solution > to that? (e.g. can we pass parameters to a named > location?) > > Thanks! > Stelios > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx Oh, I see. Maybe this: location ~ /myapp/(?.*) { root /home/stelios; try_files $uri /myapp/index.php?u=/$myquery; } location = /myapp/index.php { fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME /home/stelios/myapp/index.php; include fastcgi_params; } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199965,200179#msg-200179 From roberto at unbit.it Mon May 23 22:17:46 2011 From: roberto at unbit.it (Roberto De Ioris) Date: Mon, 23 May 2011 20:17:46 +0200 (CEST) Subject: [PATH] support for UNIX socket in abstract namespace In-Reply-To: <20110523175151.GD39527@sysoev.ru> References: <9bdc098f7db74f8cfdc102938169f26a.squirrel@manage.unbit.it> <20110523163541.GA39527@sysoev.ru> <45113c3f74b15ed88b9bdeff9a2e7a20.squirrel@manage.unbit.it> <20110523175151.GD39527@sysoev.ru> Message-ID: > On Mon, May 23, 2011 at 07:42:02PM +0200, Roberto De Ioris wrote: >> >> > On Mon, May 23, 2011 at 04:18:30PM +0200, Roberto De Ioris wrote: >> >> (Warning this is Linux only) >> >> >> >> Hi all, the attached path adds support for unix socket in abstract >> >> namespace. >> >> They are special sockets without filesystem correspondence (so you >> can >> >> use >> >> them without thinking about permissions or in chroot). In netstat >> they >> >> are >> >> reported with a '@' prefix. >> >> >> >> For example (using uWSGI): >> >> >> >> uwsgi -s @funnysock >> >> >> >> netstat -l >> >> >> >> unix 2 [ ACC ] STREAM LISTENING 23813 @funnysock >> >> >> >> After applying the patch you can connect to it with >> >> >> >> uwsgi_pass unix:@funnysock; >> >> >> >> I hope it can be useful >> > >> > Thank you for the feature. I think it's better to allow nginx >> > configuration >> > parser to support "\0" as binary 0. Then this socket may be set as >> > >> > uwsgi_pass unix:\0funnysock; >> > >> >> I fear it will require changes changes as 0 being the token delimeter in >> config parsing :( > > Could you test the attached patch ? This is the same code i made after you suggestion, but in the url parsing code (ngx_parse_unix_domain_url), ngx_cpystrn() is used and it takes '\0' in account. Changing ngx_cpystrn to not use \0 fixes the problem. Probably substituting it with ngx_memcpy is the way to go. Another thing to do is "fixing" u->addrs[0].socklen = sizeof(struct sockaddr_un); to u->addrs[0].socklen = sizeof(saun->sun_family)+len; -- Roberto De Ioris http://unbit.it From igor at sysoev.ru Mon May 23 22:37:26 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Mon, 23 May 2011 22:37:26 +0400 Subject: [PATH] support for UNIX socket in abstract namespace In-Reply-To: References: <9bdc098f7db74f8cfdc102938169f26a.squirrel@manage.unbit.it> <20110523163541.GA39527@sysoev.ru> <45113c3f74b15ed88b9bdeff9a2e7a20.squirrel@manage.unbit.it> <20110523175151.GD39527@sysoev.ru> Message-ID: <20110523183726.GE39527@sysoev.ru> On Mon, May 23, 2011 at 08:17:46PM +0200, Roberto De Ioris wrote: > > > On Mon, May 23, 2011 at 07:42:02PM +0200, Roberto De Ioris wrote: > >> > >> > On Mon, May 23, 2011 at 04:18:30PM +0200, Roberto De Ioris wrote: > > This is the same code i made after you suggestion, but in the url parsing > code (ngx_parse_unix_domain_url), ngx_cpystrn() is used and it takes '\0' > in account. > > Changing ngx_cpystrn to not use \0 fixes the problem. Probably > substituting it with ngx_memcpy is the way to go. > > Another thing to do is "fixing" > > u->addrs[0].socklen = sizeof(struct sockaddr_un); > > to > > u->addrs[0].socklen = sizeof(saun->sun_family)+len; nxg_memcpy should work here. -- Igor Sysoev From sgsfak at gmail.com Mon May 23 23:31:31 2011 From: sgsfak at gmail.com (Stelianos G. Sfakianakis) Date: Mon, 23 May 2011 22:31:31 +0300 Subject: another rewrite/try files issue In-Reply-To: <64a6135089b22eb9bfcfafb93ef9ceba.NginxMailingListEnglish@forum.nginx.org> References: <4DDA0454.5080101@gmail.com> <64a6135089b22eb9bfcfafb93ef9ceba.NginxMailingListEnglish@forum.nginx.org> Message-ID: 2011/5/23 brianmercer : > Oh, I see. ?Maybe this: > > location ~ /myapp/(?.*) { > root /home/stelios; > try_files $uri /myapp/index.php?u=/$myquery; > } > > location = /myapp/index.php { > fastcgi_pass 127.0.0.1:9000; > fastcgi_param SCRIPT_FILENAME /home/stelios/myapp/index.php; > include fastcgi_params; > } Thanks again! I finally did the following which seems to work just fine: location ~ /myapp/(.*) { root /home/stelios/myapp; set $args u=/$1&$args; try_files /$1 @fallback; } location @fallback { root /home/stelios/myapp; fastcgi_pass 127.0.0.1:9000; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root/index.php; } The "set $args ..." directive augments the QUERY_STRING with the original uri that is kept to the subsequent fastcgi call. Best regards Stelios From igor at sysoev.ru Tue May 24 00:02:27 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 24 May 2011 00:02:27 +0400 Subject: another rewrite/try files issue In-Reply-To: References: Message-ID: <20110523200226.GG39527@sysoev.ru> On Mon, May 23, 2011 at 12:20:55AM +0300, Stelianos G. Sfakianakis wrote: > Hello, > > I am having the following problem: > > - I want to have a "virtual" url e.g. "/myapp" to have a totally > different document root e.g. "/home/stelios/myapp" (instead of the > default '/var/www') > - locations of the type "/myapp/css/print.css" should respond with > the specific file at the "/home/stelios/myapp" root (i.e. with > "/home/stelios/myapp/css/print.css" > - if the the file requested does not exist, then the "index.php" > should be called via FastCGI with args "?u=$uri" (e.g. > "/myapp/users/12" should be rewritten to > "/home/stelios/myapp/index.php?u=users/12") > > I have tried the following: > > location ~ /myapp/(.*) { > root /home/stelios/myapp; > try_files /$1 /$1/ /index.php?u=$1; > } > # and the "default" PHP/FastCGI > location ~ \.php$ { > fastcgi_pass 127.0.0.1:9000; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME > $document_root$fastcgi_script_name; > include fastcgi_params; > } > > > but it seems that it doesn't work for the non files. In particular it > seems that after the internal redirect to index.php, the root is > overwritten and instead of calling my /home/stelios/myapp/index.php > the one at the default root ("/var/www/index.php") is beeing called. > > Do you know what's wrong? And possibl another way to achieve what I want? location /myapp/css/ { root /home/stelios; } location /myapp/ { root /home/stelios; try_files $uri $uri/ @php; } location @php { fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME /home/stelios/myapp/index.php; fastcgi_param QUERY_STRING u=$uri; include fastcgi_params0; } fastcgi_params0 is a copy of fastcgi_params without QUERY_STRING parameter. -- Igor Sysoev From appa at perusio.net Tue May 24 00:25:11 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Mon, 23 May 2011 21:25:11 +0100 Subject: another rewrite/try files issue In-Reply-To: References: <4DDA0454.5080101@gmail.com> <64a6135089b22eb9bfcfafb93ef9ceba.NginxMailingListEnglish@forum.nginx.org> Message-ID: <87lixxkvvc.wl%appa@perusio.net> On 23 Mai 2011 20h31 WEST, sgsfak at gmail.com wrote: > 2011/5/23 brianmercer : >> Oh, I see. ?Maybe this: >> >> location ~ /myapp/(?.*) { >> root /home/stelios; >> try_files $uri /myapp/index.php?u=/$myquery; >> } >> >> location = /myapp/index.php { >> fastcgi_pass 127.0.0.1:9000; >> fastcgi_param SCRIPT_FILENAME /home/stelios/myapp/index.php; >> include fastcgi_params; >> } > > Thanks again! > > I finally did the following which seems to work just fine: > > location ~ /myapp/(.*) { > root /home/stelios/myapp; > set $args u=/$1&$args; > try_files /$1 @fallback; > } You can do it without any set directive. Try this. location ~ /myapp/(?.*)$ { root /home/stelios/myapp; try_files /$myquery /index.php?u=/$myquery&$args; } location = /index.php { root /home/stelios/myapp; fastcgi_pass 127.0.0.1:9000; include fastcgi_params; ## Remove the line below if already defined in fastcgi_params. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } --- appa From sbc19861004 at gmail.com Tue May 24 06:49:45 2011 From: sbc19861004 at gmail.com (eagle sbc) Date: Tue, 24 May 2011 10:49:45 +0800 Subject: SSI include infinite loop Message-ID: Hello, I've encountered a problem about "SSI include infinite loop". We have a system that our editors can compose a html page from some templates using SSI. Sometimes unwarily combination will cause infinite loop, such as 'A include A', 'A include B, B include A', or even 'A include B, B include C, C include A'. And this page will cause nginx eating up all memories, and certainly won't serve any more unless we restart nginx. I'm wondering is there any solution for this problem? Or other ways to avoid this? I've googled apache and lighttpd, and there also no official solution for this, unless lightptd has a patch which will limit the whole 'include' count, and I think it's just a tricky way to fix the infinite loop. Thanks a lot for any help! -- ??????????????????? ?????????????????????????? ??????? ?????????????? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mp3geek at gmail.com Tue May 24 16:08:58 2011 From: mp3geek at gmail.com (Ryan B) Date: Wed, 25 May 2011 00:08:58 +1200 Subject: Benchmarks of cherokee vs nginx Message-ID: This is static content (only http, and no php enabled), also using gzip-static.in nginx (cache-io doesn't quite cut it in cherokee) I found the cache too aggressive in cherokee, if I upload a newer file I'd still keep serving the the cached file for a while (I wasn't actually sure when it actually expired).. so I manually lowered the expiry time for the cache (900secs), performance dives :/ Okay a quick break down of the stats.. Nginx-generated traffic is cut in half (thanks to gzip-static) vs Cherokee Nginx: 118Mb Ram, Cherokee: 260Mb CPU: nginx is by-far using less, that race isn't even close. A break down, http://i.imgur.com/JVO1w.png Both web servers packages are compiled on ubuntu 11.04/openvz hosting. From mdounin at mdounin.ru Tue May 24 16:59:01 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Tue, 24 May 2011 16:59:01 +0400 Subject: SSI include infinite loop In-Reply-To: References: Message-ID: <20110524125901.GW42265@mdounin.ru> Hello! On Tue, May 24, 2011 at 10:49:45AM +0800, eagle sbc wrote: > Hello, > > I've encountered a problem about "SSI include infinite loop". > > We have a system that our editors can compose a html page from some > templates using SSI. Sometimes unwarily combination will cause infinite > loop, such as 'A include A', 'A include B, B include A', or even 'A include > B, B include C, C include A'. And this page will cause nginx eating up all > memories, and certainly won't serve any more unless we restart nginx. > > I'm wondering is there any solution for this problem? Or other ways to avoid > this? > > I've googled apache and lighttpd, and there also no official solution for > this, unless lightptd has a patch which will limit the whole 'include' > count, and I think it's just a tricky way to fix the infinite loop. > > Thanks a lot for any help! Number of in-flight ssi includes used to be limited in nginx, though this limit was broken somewhere near 0.7.25. This patch brings it back: http://nginx.org/pipermail/nginx-devel/2011-February/000746.html Maxim Dounin From mp3geek at gmail.com Tue May 24 17:02:36 2011 From: mp3geek at gmail.com (Ryan B) Date: Wed, 25 May 2011 01:02:36 +1200 Subject: [Cherokee] Benchmarks of cherokee vs nginx In-Reply-To: References: Message-ID: I'm guessing any form of vps setup's would have issues with benchmarking.. I was hardly going to run this on my home connection or pay for a uber dedi. I'm not trying to play favourites, I'm just comparing the difference between the 2 web servers running on my vps, and its pretty obvious looking a long/short-term graphs, using the "oh you're on a openvz/vps, therefore this doesn't count" card doesn't hold. The graphs don't deviate much. The node isn't under any great load, and it would show in the graphs (I could post longer 2-3-4 days but they're pretty much the same). 2011/5/25 Tony Zakula : >> Both web servers packages are compiled on ubuntu 11.04/openvz hosting. > > Using openvz hosting? ?That is not even a real test. ?There are so > many variables, tweaks and adjustments when using OpenVZ that you > could not possibly count on that bench mark even if you controlled the > server. ?If you are using a hosting providers server, it makes it even > more nebulous because they will be using their own controls. ?The > memory and processing units are not even for real memory. ? With > OpenVZ you can tweak those at will. > > The only way to get real benchmarks is on a real machine. > > Tony > > > 2011/5/24 J?drzej Nowak : >> Hmm >> >> You can easy compress things in cherokee too. Just enable it in >> cherokee-admin ;-) >> For "gzip static" like behaviour you need to enable flcache (with >> PURGE support for your config). >> >> IOCache in cherokee is caching only plain files when you don't use >> gzip... That's why. >> >> Greetings, >> J?drzej Nowak >> >> >> >> On Tue, May 24, 2011 at 2:08 PM, Ryan B wrote: >>> This is static content (only http, and no php enabled), also using >>> gzip-static.in nginx (cache-io doesn't quite cut it in cherokee) >>> >>> I found the cache too aggressive in cherokee, if I upload a newer file >>> I'd still keep serving the the cached file for a while (I wasn't >>> actually sure when it actually expired).. so I manually lowered the >>> expiry time for the cache (900secs), performance dives :/ >>> >>> Okay a quick break down of the stats.. >>> >>> Nginx-generated traffic is cut in half (thanks to gzip-static) ?vs Cherokee >>> Nginx: 118Mb Ram, Cherokee: 260Mb >>> CPU: nginx is by-far using less, that race isn't even close. >>> >>> A break down, http://i.imgur.com/JVO1w.png >>> >>> Both web servers packages are compiled on ubuntu 11.04/openvz hosting. >>> _______________________________________________ >>> Cherokee mailing list >>> Cherokee at lists.octality.com >>> http://lists.octality.com/listinfo/cherokee >>> >> _______________________________________________ >> Cherokee mailing list >> Cherokee at lists.octality.com >> http://lists.octality.com/listinfo/cherokee >> > From nginx-forum at nginx.us Tue May 24 17:31:43 2011 From: nginx-forum at nginx.us (drmetal) Date: Tue, 24 May 2011 09:31:43 -0400 Subject: cache large static files in memory In-Reply-To: <5a11b2303ae5c2a8da3a2c89752907dc.NginxMailingList@forum.nginx.org> References: <758641620906232200h4128ad0av103dbfafc78e612e@mail.gmail.com> <932ea6c90906232253t7d68e9f9n8267b56d9871fd63@mail.gmail.com> <758641620906232318o8fe6f40i9a21346aefc3d822@mail.gmail.com> <932ea6c90906240041o7ec3ad5dlb2c4c35ad6a15f3e@mail.gmail.com> <758641620906240354t1e0ed134xaf09987799fd77e0@forum.nginx.org> <5a11b2303ae5c2a8da3a2c89752907dc.NginxMailingList@forum.nginx.org> Message-ID: <234e8b3486b4fd4cd7adacf815c70ea2.NginxMailingListEnglish@forum.nginx.org> Hello, does this (linux RAM cache) apply to OpenVZ machines (Guests)? Because when I run free -m command, i see 0 in buffers and cached. Anyone knows how that goes in OpenVZ? Thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,3316,200352#msg-200352 From skebi69 at gmail.com Tue May 24 18:00:49 2011 From: skebi69 at gmail.com (John Kennedy) Date: Tue, 24 May 2011 15:00:49 +0100 Subject: Wildcard domains as vhost Message-ID: I tried to google this but could not hit the right keywords (been a long week)... We have DNS set up so that all requests ending in .project.example.com (i.e. bob.project.example.com) go to the same machine. How can I set up sites-enabled so that all requests for *.project.example.com get treated the same? Thanks, John -- John Kennedy -------------- next part -------------- An HTML attachment was scrubbed... URL: From mat999 at gmail.com Tue May 24 18:03:57 2011 From: mat999 at gmail.com (SplitIce) Date: Wed, 25 May 2011 00:03:57 +1000 Subject: Wildcard domains as vhost In-Reply-To: References: Message-ID: look in the wiki at the server_name directive. (wildcards) On Wed, May 25, 2011 at 12:00 AM, John Kennedy wrote: > I tried to google this but could not hit the right keywords (been a long > week)... > > We have DNS set up so that all requests ending in .project.example.com(i.e. > bob.project.example.com) go to the same machine. How can I set up > sites-enabled so that all requests for *.project.example.com get treated > the same? > > Thanks, > John > > -- > John Kennedy > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From skebi69 at gmail.com Tue May 24 18:11:52 2011 From: skebi69 at gmail.com (John Kennedy) Date: Tue, 24 May 2011 15:11:52 +0100 Subject: Wildcard domains as vhost In-Reply-To: References: Message-ID: That was what I was looking for. Thanks. John On Tue, May 24, 2011 at 15:03, SplitIce wrote: > look in the wiki at the server_name directive. (wildcards) > > On Wed, May 25, 2011 at 12:00 AM, John Kennedy wrote: > >> I tried to google this but could not hit the right keywords (been a long >> week)... >> >> We have DNS set up so that all requests ending in .project.example.com(i.e. >> bob.project.example.com) go to the same machine. How can I set up >> sites-enabled so that all requests for *.project.example.com get treated >> the same? >> >> Thanks, >> John >> >> -- >> John Kennedy >> >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://nginx.org/mailman/listinfo/nginx >> >> > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > > -- John Kennedy -------------- next part -------------- An HTML attachment was scrubbed... URL: From appa at perusio.net Tue May 24 18:13:02 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Tue, 24 May 2011 15:13:02 +0100 Subject: Wildcard domains as vhost In-Reply-To: References: Message-ID: <87ipt0kx01.wl%appa@perusio.net> On 24 Mai 2011 15h00 WEST, skebi69 at gmail.com wrote: > [1 ] [1.1 (7bit)>] I tried to google this but could not hit the right keywords > (been a long week)... > > We have DNS set up so that all requests ending in > .project.example.com (i.e. bob.project.example.com) go to the same > machine. How can I set up sites-enabled so that all requests for > *.project.example.com get treated the same? Cf. http://nginx.org/en/docs/http/server_names.html#wildcard_names server { server_name *.project.example.com; (...) } --- appa From cliff at develix.com Tue May 24 18:14:25 2011 From: cliff at develix.com (Cliff Wells) Date: Tue, 24 May 2011 07:14:25 -0700 Subject: [Cherokee] Benchmarks of cherokee vs nginx In-Reply-To: References: Message-ID: <1306246465.2327.20.camel@portable-evil> On Wed, 2011-05-25 at 01:02 +1200, Ryan B wrote: > I'm guessing any form of vps setup's would have issues with > benchmarking.. I was hardly going to run this on my home connection or > pay for a uber dedi. Actually, it's a fine benchmark so long as both HTTP servers are running in the same environment. Can you extrapolate and draw conclusions about how they might run on different hardware or in a different environment? Maybe with a grain of salt, but that's the case with any benchmark, so complaining about OpenVZ tuning is pointless. Putting it on dedicated hardware isn't terribly useful either, since fewer people do that now. Even dedicated servers are virtualized for management reasons. The only issue I'd have is if the node has other VE's on it that you don't have control over since those could clearly affect the outcome. Still I'd expect deviations to show from multiple runs that would reveal that type of issue. Cliff From cliff at develix.com Tue May 24 18:39:39 2011 From: cliff at develix.com (Cliff Wells) Date: Tue, 24 May 2011 07:39:39 -0700 Subject: [Cherokee] Benchmarks of cherokee vs nginx In-Reply-To: References: <1306246465.2327.20.camel@portable-evil> Message-ID: <1306247979.2327.31.camel@portable-evil> On Tue, 2011-05-24 at 09:25 -0500, Tony Zakula wrote: > I am not complaining about OpenVZ. I deploy servers on a regular > basis using OpenVZ. I also deploy using KVM, and others. There is a > massive difference between OpenVZ and KVM in implementation, system > stability, etc. They are entirely different animals. You cannot > discount the hypervisor. The hypervisor can make or break your > application depending on how you're application is structured. For > instance, Java apps run great on KVM hypervisors, but really poor if > at all on OpenVZ unless you tune the OpenVZ instance to meet your Java > apps needs. The reason for that is the way Java handles memory. > Threads is another big issue hypervisors. To say that the hypervisor > has no effect on application performance is not accurate at all. So are you suggesting no benchmark is ever valid unless it is run on every hypervisor available as well as on the bare metal? Clearly every benchmark has defined parameters, and in this case OpenVZ was one of those parameters. So long as the benchmark is defined as "Nginx vs Cherokee under OpenVZ" then it's a perfectly valid benchmark. Cliff From cliff at develix.com Tue May 24 18:48:19 2011 From: cliff at develix.com (Cliff Wells) Date: Tue, 24 May 2011 07:48:19 -0700 Subject: [Cherokee] Benchmarks of cherokee vs nginx In-Reply-To: <1306247979.2327.31.camel@portable-evil> References: <1306246465.2327.20.camel@portable-evil> <1306247979.2327.31.camel@portable-evil> Message-ID: <1306248499.2327.34.camel@portable-evil> On Tue, 2011-05-24 at 07:39 -0700, Cliff Wells wrote: > On Tue, 2011-05-24 at 09:25 -0500, Tony Zakula wrote: > > I am not complaining about OpenVZ. I deploy servers on a regular > > basis using OpenVZ. I also deploy using KVM, and others. There is a > > massive difference between OpenVZ and KVM in implementation, system > > stability, etc. They are entirely different animals. You cannot > > discount the hypervisor. The hypervisor can make or break your > > application depending on how you're application is structured. For > > instance, Java apps run great on KVM hypervisors, but really poor if > > at all on OpenVZ unless you tune the OpenVZ instance to meet your Java > > apps needs. The reason for that is the way Java handles memory. > > Threads is another big issue hypervisors. To say that the hypervisor > > has no effect on application performance is not accurate at all. > > So are you suggesting no benchmark is ever valid unless it is run on > every hypervisor available as well as on the bare metal? Clearly every > benchmark has defined parameters, and in this case OpenVZ was one of > those parameters. > > So long as the benchmark is defined as "Nginx vs Cherokee under OpenVZ" > then it's a perfectly valid benchmark. Let me clarify that last sentence: there are other issues that might invalidate this benchmark (should be run on a dedicated LAN and on a dedicated node at least), but the virtualization (or lack of) isn't one of those factors. Cliff From cliff at develix.com Tue May 24 19:04:38 2011 From: cliff at develix.com (Cliff Wells) Date: Tue, 24 May 2011 08:04:38 -0700 Subject: [Cherokee] Benchmarks of cherokee vs nginx In-Reply-To: References: <1306246465.2327.20.camel@portable-evil> <1306247979.2327.31.camel@portable-evil> Message-ID: <1306249478.2327.37.camel@portable-evil> On Tue, 2011-05-24 at 09:50 -0500, Tony Zakula wrote: > Was there any info on how OpenVZ was setup or how many other > containers were running on the machine, Do we know what the load was > on the machine at each stage of the tests? We really do not know > anything. The web servers were not even setup the same. The hosting > outfit could see a system spike and automatically kick in a limit that > we do not know about. I do that all the time. That is a common > practice. If you do not control the system, you cannot do a valid > benchmark. I agree with that. I only disagree with your earlier, broader assessment. Cliff From jelledejong at powercraft.nl Tue May 24 19:19:10 2011 From: jelledejong at powercraft.nl (Jelle de Jong) Date: Tue, 24 May 2011 17:19:10 +0200 Subject: TCP: time wait bucket table overflow Message-ID: <4DDBCC6E.7080806@powercraft.nl> I am just going to pop-up this question. My nginx was doing about 10% cpu load and I was getting: May 24 15:58:43 yasmin kernel: [ 983.444403] TCP: time wait bucket table overflow I know I can fine-tune my /proc/sys/net/ipv4/tcp_max_tw_buckets and some other stuff. But I am pretty sure somebody here has more experience with tcp tuning. What are good Linux kernel settings for a proxy_pass / load balancer nginx server? Some URL's to background articles would be nice. In my configuration it passes everything to Apache servers as back-ends. Thanks in advance, Kind regards, Jelle de Jong From me at pigmej.eu Tue May 24 16:17:07 2011 From: me at pigmej.eu (=?UTF-8?Q?J=C4=99drzej_Nowak?=) Date: Tue, 24 May 2011 14:17:07 +0200 Subject: [Cherokee] Benchmarks of cherokee vs nginx In-Reply-To: References: Message-ID: Hmm You can easy compress things in cherokee too. Just enable it in cherokee-admin ;-) For "gzip static" like behaviour you need to enable flcache (with PURGE support for your config). IOCache in cherokee is caching only plain files when you don't use gzip... That's why. Greetings, J?drzej Nowak On Tue, May 24, 2011 at 2:08 PM, Ryan B wrote: > This is static content (only http, and no php enabled), also using > gzip-static.in nginx (cache-io doesn't quite cut it in cherokee) > > I found the cache too aggressive in cherokee, if I upload a newer file > I'd still keep serving the the cached file for a while (I wasn't > actually sure when it actually expired).. so I manually lowered the > expiry time for the cache (900secs), performance dives :/ > > Okay a quick break down of the stats.. > > Nginx-generated traffic is cut in half (thanks to gzip-static) ?vs Cherokee > Nginx: 118Mb Ram, Cherokee: 260Mb > CPU: nginx is by-far using less, that race isn't even close. > > A break down, http://i.imgur.com/JVO1w.png > > Both web servers packages are compiled on ubuntu 11.04/openvz hosting. > _______________________________________________ > Cherokee mailing list > Cherokee at lists.octality.com > http://lists.octality.com/listinfo/cherokee > From tonyzakula at gmail.com Tue May 24 16:33:11 2011 From: tonyzakula at gmail.com (Tony Zakula) Date: Tue, 24 May 2011 07:33:11 -0500 Subject: [Cherokee] Benchmarks of cherokee vs nginx In-Reply-To: References: Message-ID: > Both web servers packages are compiled on ubuntu 11.04/openvz hosting. Using openvz hosting? That is not even a real test. There are so many variables, tweaks and adjustments when using OpenVZ that you could not possibly count on that bench mark even if you controlled the server. If you are using a hosting providers server, it makes it even more nebulous because they will be using their own controls. The memory and processing units are not even for real memory. With OpenVZ you can tweak those at will. The only way to get real benchmarks is on a real machine. Tony 2011/5/24 J?drzej Nowak : > Hmm > > You can easy compress things in cherokee too. Just enable it in > cherokee-admin ;-) > For "gzip static" like behaviour you need to enable flcache (with > PURGE support for your config). > > IOCache in cherokee is caching only plain files when you don't use > gzip... That's why. > > Greetings, > J?drzej Nowak > > > > On Tue, May 24, 2011 at 2:08 PM, Ryan B wrote: >> This is static content (only http, and no php enabled), also using >> gzip-static.in nginx (cache-io doesn't quite cut it in cherokee) >> >> I found the cache too aggressive in cherokee, if I upload a newer file >> I'd still keep serving the the cached file for a while (I wasn't >> actually sure when it actually expired).. so I manually lowered the >> expiry time for the cache (900secs), performance dives :/ >> >> Okay a quick break down of the stats.. >> >> Nginx-generated traffic is cut in half (thanks to gzip-static) ?vs Cherokee >> Nginx: 118Mb Ram, Cherokee: 260Mb >> CPU: nginx is by-far using less, that race isn't even close. >> >> A break down, http://i.imgur.com/JVO1w.png >> >> Both web servers packages are compiled on ubuntu 11.04/openvz hosting. >> _______________________________________________ >> Cherokee mailing list >> Cherokee at lists.octality.com >> http://lists.octality.com/listinfo/cherokee >> > _______________________________________________ > Cherokee mailing list > Cherokee at lists.octality.com > http://lists.octality.com/listinfo/cherokee > From me at pigmej.eu Tue May 24 17:04:44 2011 From: me at pigmej.eu (=?UTF-8?Q?J=C4=99drzej_Nowak?=) Date: Tue, 24 May 2011 15:04:44 +0200 Subject: [Cherokee] Benchmarks of cherokee vs nginx In-Reply-To: References: Message-ID: Well... You compared cherokee without GZIP to nginx with GZIP... And you're comparing a memory used by cache... It's a miss point. Greetings, J?drzej Nowak On Tue, May 24, 2011 at 3:02 PM, Ryan B wrote: > I'm guessing any form of vps setup's would have issues with > benchmarking.. I was hardly going to run this on my home connection or > pay for a uber dedi. I'm not trying to play favourites, I'm just > comparing the difference between the 2 web servers running on my vps, > and its pretty obvious looking a long/short-term graphs, using the "oh > you're on a openvz/vps, therefore this doesn't count" card doesn't > hold. > > The graphs don't deviate much. The node isn't under any great load, > and it would show in the graphs (I could post longer 2-3-4 days but > they're pretty much the same). > > > 2011/5/25 Tony Zakula : >>> Both web servers packages are compiled on ubuntu 11.04/openvz hosting. >> >> Using openvz hosting? ?That is not even a real test. ?There are so >> many variables, tweaks and adjustments when using OpenVZ that you >> could not possibly count on that bench mark even if you controlled the >> server. ?If you are using a hosting providers server, it makes it even >> more nebulous because they will be using their own controls. ?The >> memory and processing units are not even for real memory. ? With >> OpenVZ you can tweak those at will. >> >> The only way to get real benchmarks is on a real machine. >> >> Tony >> >> >> 2011/5/24 J?drzej Nowak : >>> Hmm >>> >>> You can easy compress things in cherokee too. Just enable it in >>> cherokee-admin ;-) >>> For "gzip static" like behaviour you need to enable flcache (with >>> PURGE support for your config). >>> >>> IOCache in cherokee is caching only plain files when you don't use >>> gzip... That's why. >>> >>> Greetings, >>> J?drzej Nowak >>> >>> >>> >>> On Tue, May 24, 2011 at 2:08 PM, Ryan B wrote: >>>> This is static content (only http, and no php enabled), also using >>>> gzip-static.in nginx (cache-io doesn't quite cut it in cherokee) >>>> >>>> I found the cache too aggressive in cherokee, if I upload a newer file >>>> I'd still keep serving the the cached file for a while (I wasn't >>>> actually sure when it actually expired).. so I manually lowered the >>>> expiry time for the cache (900secs), performance dives :/ >>>> >>>> Okay a quick break down of the stats.. >>>> >>>> Nginx-generated traffic is cut in half (thanks to gzip-static) ?vs Cherokee >>>> Nginx: 118Mb Ram, Cherokee: 260Mb >>>> CPU: nginx is by-far using less, that race isn't even close. >>>> >>>> A break down, http://i.imgur.com/JVO1w.png >>>> >>>> Both web servers packages are compiled on ubuntu 11.04/openvz hosting. >>>> _______________________________________________ >>>> Cherokee mailing list >>>> Cherokee at lists.octality.com >>>> http://lists.octality.com/listinfo/cherokee >>>> >>> _______________________________________________ >>> Cherokee mailing list >>> Cherokee at lists.octality.com >>> http://lists.octality.com/listinfo/cherokee >>> >> > _______________________________________________ > Cherokee mailing list > Cherokee at lists.octality.com > http://lists.octality.com/listinfo/cherokee > From tonyzakula at gmail.com Tue May 24 17:15:12 2011 From: tonyzakula at gmail.com (Tony Zakula) Date: Tue, 24 May 2011 08:15:12 -0500 Subject: [Cherokee] Benchmarks of cherokee vs nginx In-Reply-To: References: Message-ID: Right, as with any benchmark, it is better to say up front what conditions you tested with, how you tested, and what variables were involved. So myhost.com, with this VPS package, with Cherokee configured this way, and Nginx configured this way, etc. It is not a "this doesn't count card" to you, but it is for most people. I am happy to see people share, after all, the conclusion would be, migrate to a host that better supports Cherokee if you love using it, or ask your host to tweak their VPS if you cannot get the benchmarks acceptable. The conclusion is not that Nginx is better than Cherokee. Even those memory and cpu numbers are totally fake. They are software numbers fed by OpenVZ to the container. Tony 2011/5/24 J?drzej Nowak : > Well... > > You compared cherokee without GZIP to nginx with GZIP... And you're > comparing a memory used by cache... > It's a miss point. > > Greetings, > J?drzej Nowak > > > > On Tue, May 24, 2011 at 3:02 PM, Ryan B wrote: >> I'm guessing any form of vps setup's would have issues with >> benchmarking.. I was hardly going to run this on my home connection or >> pay for a uber dedi. I'm not trying to play favourites, I'm just >> comparing the difference between the 2 web servers running on my vps, >> and its pretty obvious looking a long/short-term graphs, using the "oh >> you're on a openvz/vps, therefore this doesn't count" card doesn't >> hold. >> >> The graphs don't deviate much. The node isn't under any great load, >> and it would show in the graphs (I could post longer 2-3-4 days but >> they're pretty much the same). >> >> >> 2011/5/25 Tony Zakula : >>>> Both web servers packages are compiled on ubuntu 11.04/openvz hosting. >>> >>> Using openvz hosting? ?That is not even a real test. ?There are so >>> many variables, tweaks and adjustments when using OpenVZ that you >>> could not possibly count on that bench mark even if you controlled the >>> server. ?If you are using a hosting providers server, it makes it even >>> more nebulous because they will be using their own controls. ?The >>> memory and processing units are not even for real memory. ? With >>> OpenVZ you can tweak those at will. >>> >>> The only way to get real benchmarks is on a real machine. >>> >>> Tony >>> >>> >>> 2011/5/24 J?drzej Nowak : >>>> Hmm >>>> >>>> You can easy compress things in cherokee too. Just enable it in >>>> cherokee-admin ;-) >>>> For "gzip static" like behaviour you need to enable flcache (with >>>> PURGE support for your config). >>>> >>>> IOCache in cherokee is caching only plain files when you don't use >>>> gzip... That's why. >>>> >>>> Greetings, >>>> J?drzej Nowak >>>> >>>> >>>> >>>> On Tue, May 24, 2011 at 2:08 PM, Ryan B wrote: >>>>> This is static content (only http, and no php enabled), also using >>>>> gzip-static.in nginx (cache-io doesn't quite cut it in cherokee) >>>>> >>>>> I found the cache too aggressive in cherokee, if I upload a newer file >>>>> I'd still keep serving the the cached file for a while (I wasn't >>>>> actually sure when it actually expired).. so I manually lowered the >>>>> expiry time for the cache (900secs), performance dives :/ >>>>> >>>>> Okay a quick break down of the stats.. >>>>> >>>>> Nginx-generated traffic is cut in half (thanks to gzip-static) ?vs Cherokee >>>>> Nginx: 118Mb Ram, Cherokee: 260Mb >>>>> CPU: nginx is by-far using less, that race isn't even close. >>>>> >>>>> A break down, http://i.imgur.com/JVO1w.png >>>>> >>>>> Both web servers packages are compiled on ubuntu 11.04/openvz hosting. >>>>> _______________________________________________ >>>>> Cherokee mailing list >>>>> Cherokee at lists.octality.com >>>>> http://lists.octality.com/listinfo/cherokee >>>>> >>>> _______________________________________________ >>>> Cherokee mailing list >>>> Cherokee at lists.octality.com >>>> http://lists.octality.com/listinfo/cherokee >>>> >>> >> _______________________________________________ >> Cherokee mailing list >> Cherokee at lists.octality.com >> http://lists.octality.com/listinfo/cherokee >> > From tonyzakula at gmail.com Tue May 24 18:25:19 2011 From: tonyzakula at gmail.com (Tony Zakula) Date: Tue, 24 May 2011 09:25:19 -0500 Subject: [Cherokee] Benchmarks of cherokee vs nginx In-Reply-To: <1306246465.2327.20.camel@portable-evil> References: <1306246465.2327.20.camel@portable-evil> Message-ID: I am not complaining about OpenVZ. I deploy servers on a regular basis using OpenVZ. I also deploy using KVM, and others. There is a massive difference between OpenVZ and KVM in implementation, system stability, etc. They are entirely different animals. You cannot discount the hypervisor. The hypervisor can make or break your application depending on how you're application is structured. For instance, Java apps run great on KVM hypervisors, but really poor if at all on OpenVZ unless you tune the OpenVZ instance to meet your Java apps needs. The reason for that is the way Java handles memory. Threads is another big issue hypervisors. To say that the hypervisor has no effect on application performance is not accurate at all. Tony On Tue, May 24, 2011 at 9:14 AM, Cliff Wells wrote: > On Wed, 2011-05-25 at 01:02 +1200, Ryan B wrote: >> I'm guessing any form of vps setup's would have issues with >> benchmarking.. I was hardly going to run this on my home connection or >> pay for a uber dedi. > > Actually, it's a fine benchmark so long as both HTTP servers are running > in the same environment. ?Can you extrapolate and draw conclusions about > how they might run on different hardware or in a different environment? > Maybe with a grain of salt, but that's the case with any benchmark, so > complaining about OpenVZ tuning is pointless. > > Putting it on dedicated hardware isn't terribly useful either, since > fewer people do that now. Even dedicated servers are virtualized for > management reasons. > > The only issue I'd have is if the node has other VE's on it that you > don't have control over since those could clearly affect the outcome. > Still I'd expect deviations to show from multiple runs that would reveal > that type of issue. > > Cliff > > > From tonyzakula at gmail.com Tue May 24 18:50:52 2011 From: tonyzakula at gmail.com (Tony Zakula) Date: Tue, 24 May 2011 09:50:52 -0500 Subject: [Cherokee] Benchmarks of cherokee vs nginx In-Reply-To: <1306247979.2327.31.camel@portable-evil> References: <1306246465.2327.20.camel@portable-evil> <1306247979.2327.31.camel@portable-evil> Message-ID: Was there any info on how OpenVZ was setup or how many other containers were running on the machine, Do we know what the load was on the machine at each stage of the tests? We really do not know anything. The web servers were not even setup the same. The hosting outfit could see a system spike and automatically kick in a limit that we do not know about. I do that all the time. That is a common practice. If you do not control the system, you cannot do a valid benchmark. On Tue, May 24, 2011 at 9:39 AM, Cliff Wells wrote: > On Tue, 2011-05-24 at 09:25 -0500, Tony Zakula wrote: >> I am not complaining about OpenVZ. ?I deploy servers on a regular >> basis using OpenVZ. ?I also deploy using KVM, and others. ?There is a >> massive difference between OpenVZ and KVM in implementation, system >> stability, etc. ?They are entirely different animals. ?You cannot >> discount the hypervisor. ?The hypervisor can make or break your >> application depending on how you're application is structured. ?For >> instance, Java apps run great on KVM hypervisors, but really poor if >> at all on OpenVZ unless you tune the OpenVZ instance to meet your Java >> apps needs. ?The reason for that is the way Java handles memory. >> Threads is another big issue hypervisors. To say that the hypervisor >> has no effect on application performance is not accurate at all. > > So are you suggesting no benchmark is ever valid unless it is run on > every hypervisor available as well as on the bare metal? ?Clearly every > benchmark has defined parameters, and in this case OpenVZ was one of > those parameters. > > So long as the benchmark is defined as "Nginx vs Cherokee under OpenVZ" > then it's a perfectly valid benchmark. > > Cliff > > From tonyzakula at gmail.com Tue May 24 18:52:41 2011 From: tonyzakula at gmail.com (Tony Zakula) Date: Tue, 24 May 2011 09:52:41 -0500 Subject: [Cherokee] Benchmarks of cherokee vs nginx In-Reply-To: References: <1306246465.2327.20.camel@portable-evil> <1306247979.2327.31.camel@portable-evil> Message-ID: And you certainly cannot report on memory consumption relying on OpenVZ fake memory numbers. On Tue, May 24, 2011 at 9:50 AM, Tony Zakula wrote: > Was there any info on how OpenVZ was setup or how many other > containers were running on the machine, Do we know what the load was > on the machine at each stage of the tests? ?We really do not know > anything. ?The web servers were not even setup the same. ?The hosting > outfit could see a system spike and automatically kick in a limit that > we do not know about. I do that all the time. That is a common > practice. ?If you do not control the system, you cannot do a valid > benchmark. > > On Tue, May 24, 2011 at 9:39 AM, Cliff Wells wrote: >> On Tue, 2011-05-24 at 09:25 -0500, Tony Zakula wrote: >>> I am not complaining about OpenVZ. ?I deploy servers on a regular >>> basis using OpenVZ. ?I also deploy using KVM, and others. ?There is a >>> massive difference between OpenVZ and KVM in implementation, system >>> stability, etc. ?They are entirely different animals. ?You cannot >>> discount the hypervisor. ?The hypervisor can make or break your >>> application depending on how you're application is structured. ?For >>> instance, Java apps run great on KVM hypervisors, but really poor if >>> at all on OpenVZ unless you tune the OpenVZ instance to meet your Java >>> apps needs. ?The reason for that is the way Java handles memory. >>> Threads is another big issue hypervisors. To say that the hypervisor >>> has no effect on application performance is not accurate at all. >> >> So are you suggesting no benchmark is ever valid unless it is run on >> every hypervisor available as well as on the bare metal? ?Clearly every >> benchmark has defined parameters, and in this case OpenVZ was one of >> those parameters. >> >> So long as the benchmark is defined as "Nginx vs Cherokee under OpenVZ" >> then it's a perfectly valid benchmark. >> >> Cliff >> >> > From tonyzakula at gmail.com Tue May 24 19:12:22 2011 From: tonyzakula at gmail.com (Tony Zakula) Date: Tue, 24 May 2011 10:12:22 -0500 Subject: [Cherokee] Benchmarks of cherokee vs nginx In-Reply-To: <1306249478.2327.37.camel@portable-evil> References: <1306246465.2327.20.camel@portable-evil> <1306247979.2327.31.camel@portable-evil> <1306249478.2327.37.camel@portable-evil> Message-ID: On Tue, May 24, 2011 at 10:04 AM, Cliff Wells wrote: > On Tue, 2011-05-24 at 09:50 -0500, Tony Zakula wrote: >> Was there any info on how OpenVZ was setup or how many other >> containers were running on the machine, Do we know what the load was >> on the machine at each stage of the tests? ?We really do not know >> anything. ?The web servers were not even setup the same. ?The hosting >> outfit could see a system spike and automatically kick in a limit that >> we do not know about. I do that all the time. That is a common >> practice. ?If you do not control the system, you cannot do a valid >> benchmark. > > I agree with that. ?I only disagree with your earlier, broader > assessment. > > Cliff I should have been more clear. Point well taken. From lpr at dyb.fm Tue May 24 20:53:29 2011 From: lpr at dyb.fm (Felipe aka lpr) Date: Tue, 24 May 2011 13:53:29 -0300 Subject: cache large static files in memory In-Reply-To: <234e8b3486b4fd4cd7adacf815c70ea2.NginxMailingListEnglish@forum.nginx.org> References: <758641620906232200h4128ad0av103dbfafc78e612e@mail.gmail.com> <932ea6c90906232253t7d68e9f9n8267b56d9871fd63@mail.gmail.com> <758641620906232318o8fe6f40i9a21346aefc3d822@mail.gmail.com> <932ea6c90906240041o7ec3ad5dlb2c4c35ad6a15f3e@mail.gmail.com> <758641620906240354t1e0ed134xaf09987799fd77e0@forum.nginx.org> <5a11b2303ae5c2a8da3a2c89752907dc.NginxMailingList@forum.nginx.org> <234e8b3486b4fd4cd7adacf815c70ea2.NginxMailingListEnglish@forum.nginx.org> Message-ID: openvz uses conteiner virtualization. The memory is shared with other vm's. The configuration of yourvz.conf show how much is your guaranteed memory, and bursted memory. And its not possible add a swap disk using swapon to a file image. Em 24/05/2011, ?s 10:31, drmetal escreveu: > Hello, does this (linux RAM cache) apply to OpenVZ machines (Guests)? > > Because when I run free -m command, i see 0 in buffers and cached. > > Anyone knows how that goes in OpenVZ? > > Thanks > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,3316,200352#msg-200352 > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Tue May 24 23:25:25 2011 From: nginx-forum at nginx.us (Trazzt) Date: Tue, 24 May 2011 15:25:25 -0400 Subject: Configuring phpmyadmin Message-ID: <803a4e8efdcc2152348d257454089b78.NginxMailingListEnglish@forum.nginx.org> Hi, I recently installed Debian 6.0.1a Squeeze with Nginx and phpmyadmin When I go to 'http://localhost' phpmyadmin pops up. What I want is that phpmyadmin is located at 'http://localhost/phpmyadmin/' I already tried to add this in nginx.conf. It didn't work location /phpmyadmin { alias /usr/share/phpmyadmin/; } This is what my nginx.conf looks like: _____________________________________ user www-data; worker_processes 1; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 1024; # multi_accept on; } http { include /etc/nginx/mime.types; access_log /var/log/nginx/access.log; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; tcp_nodelay on; gzip on; gzip_disable "MSIE [1-6]\.(?!.*SV1)"; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } _____________________________________ Can anybody help me configuring this the right way? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200488,200488#msg-200488 From nginx-forum at nginx.us Wed May 25 01:04:11 2011 From: nginx-forum at nginx.us (urschrei) Date: Tue, 24 May 2011 17:04:11 -0400 Subject: Provide site-specific SSL cert on behalf of clients Message-ID: I'm wondering if I can configure nginx to provide a PEM SSL cert for a specific site on behalf of clients on my subnet, and how I might go about configuring, testing this. I have a cert in PEM format, and nginx 0.8.54 with SSL support, running on Ubuntu 11.04. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200521,200521#msg-200521 From nginx-forum at nginx.us Wed May 25 01:14:02 2011 From: nginx-forum at nginx.us (drmetal) Date: Tue, 24 May 2011 17:14:02 -0400 Subject: cache large static files in memory In-Reply-To: References: Message-ID: Thanks for the answer but this doesn't answer my question. Obviously I have shared RAM. My question was, does linux store frequently used files in RAM ? Because this is usually reported in the free -m command output. But in the case of OpenVZ VPS I see nothing (0) in the cached and buffers column. I researched a little, the system caches files, they are just not reported. Felipe aka lpr Wrote: ------------------------------------------------------- > openvz uses conteiner virtualization. > > The memory is shared with other vm's. > > The configuration of yourvz.conf show how much is > your guaranteed memory, and bursted memory. > > And its not possible add a swap disk using swapon > to a file image. > > Em 24/05/2011, ?s 10:31, drmetal escreveu: > > > Hello, does this (linux RAM cache) apply to > OpenVZ machines (Guests)? > > > > Because when I run free -m command, i see 0 in > buffers and cached. > > > > Anyone knows how that goes in OpenVZ? > > > > Thanks > > > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,3316,200352#msg- > 200352 > > > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://nginx.org/mailman/listinfo/nginx > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx Posted at Nginx Forum: http://forum.nginx.org/read.php?2,3316,200528#msg-200528 From caldcv at gmail.com Wed May 25 03:15:26 2011 From: caldcv at gmail.com (Chris) Date: Tue, 24 May 2011 19:15:26 -0400 Subject: Configuring phpmyadmin In-Reply-To: <803a4e8efdcc2152348d257454089b78.NginxMailingListEnglish@forum.nginx.org> References: <803a4e8efdcc2152348d257454089b78.NginxMailingListEnglish@forum.nginx.org> Message-ID: Post your /etc/nginx/sites-enabled/ files and also, keeping phpmyadmin on a public directory is bad since bots / scripts automatically scan for that in URLs. Restrict it with .htaccess if you want to keep phpmyadmin as the directory name or change it to something like "fuzzykittens" to hide it. On 5/24/11, Trazzt wrote: > Hi, > > I recently installed Debian 6.0.1a Squeeze with Nginx and phpmyadmin > When I go to 'http://localhost' phpmyadmin pops up. > What I want is that phpmyadmin is located at > 'http://localhost/phpmyadmin/' > > I already tried to add this in nginx.conf. It didn't work > > location /phpmyadmin { > alias /usr/share/phpmyadmin/; > } > > This is what my nginx.conf looks like: > > _____________________________________ > user www-data; > worker_processes 1; > > error_log /var/log/nginx/error.log; > pid /var/run/nginx.pid; > > events { > worker_connections 1024; > # multi_accept on; > } > > http { > include /etc/nginx/mime.types; > > access_log /var/log/nginx/access.log; > > sendfile on; > #tcp_nopush on; > > #keepalive_timeout 0; > keepalive_timeout 65; > tcp_nodelay on; > > gzip on; > gzip_disable "MSIE [1-6]\.(?!.*SV1)"; > > include /etc/nginx/conf.d/*.conf; > include /etc/nginx/sites-enabled/*; > } > _____________________________________ > > Can anybody help me configuring this the right way? > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,200488,200488#msg-200488 > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -- --C "The dumber people think you are, the more surprised they're going to be when you kill them." - Sir William Clayton From gvimrc at gmail.com Wed May 25 03:16:05 2011 From: gvimrc at gmail.com (gvim) Date: Wed, 25 May 2011 00:16:05 +0100 Subject: Cache problem? Message-ID: <4DDC3C35.5080400@gmail.com> I'm running a Perl/PSGI CGI::Application app on nginx via proxy_pass to Starman. The app logs form fields to a database and retrieves a resultset which is served up via Template Toolkit. Running on Apache as a plain vanilla CGI without the PSGI layer I can submit the form, press the Back button when the resultset is returned and re-hit the submit button, all within a second or 2 without any errors. However, with nginx + Starman the same app produces a random number of successful responses then returns an error page from the app as if there were 1 form field too many. It looks like some kind of cached response because even if I remove the module which runs this part of the app I still see the same app-generated error page. Since both nginx and Starman are returning a HTTP body there are no errors in the logs of either daemon to work with. gvim From zzz at zzz.org.ua Wed May 25 03:39:14 2011 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Wed, 25 May 2011 02:39:14 +0300 Subject: Cache problem? In-Reply-To: <4DDC3C35.5080400@gmail.com> References: <4DDC3C35.5080400@gmail.com> Message-ID: On 5/25/11, gvim wrote: > I'm running a Perl/PSGI CGI::Application app on nginx via proxy_pass to > Starman. The app logs form fields to a database and retrieves a resultset > which is served up via Template Toolkit. Running on Apache as a plain > vanilla CGI without the PSGI layer I can submit the form, press the Back > button when the resultset is returned and re-hit the submit button, all > within a second or 2 without any errors. However, with nginx + Starman the > same app produces a random number of successful responses then returns an > error page from the app as if there were 1 form field too many. It looks > like some kind of cached response because even if I remove the module which > runs this part of the app I still see the same app-generated error page. It's probably not related to caching whatsoever unless there is a proxy_cache somewhere in the server block. > Since both nginx and Starman are returning a HTTP body there are no errors > in the logs of either daemon to work with. How about response status? Anyway, it might be a long shot, but have you tried switching Starman to a different PSGI server, like Twiggy or Feersum? After all PSGI is a relatively new thing for perl and not that widely used. From gvimrc at gmail.com Wed May 25 04:02:15 2011 From: gvimrc at gmail.com (gvim) Date: Wed, 25 May 2011 01:02:15 +0100 Subject: Cache problem? In-Reply-To: References: <4DDC3C35.5080400@gmail.com> Message-ID: <4DDC4707.5030708@gmail.com> On 25/05/2011 00:39, Alexandr Gomoliako wrote: > > How about response status? > All 200. The app is returning HTTP content so I don't expect to see any errors on the logs of nginx or Starman. > Anyway, it might be a long shot, but have you tried switching Starman > to a different PSGI server, like Twiggy or Feersum? After all PSGI is > a relatively new thing for perl and not that widely used. Of the ones you've listed Starman is the more established. My ngxing vhosts file has this kind of setup: server { root /var/www/html/myapp/pub; server_name myappserver; location ~ \.psgi { gzip off; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://127.0.0.1:9000; } } ... with Starman running on 127.0.0.1:9000 PSGI/Plack is THE big thing in Perl right now so it's actually getting a lot of use, especially within the CGI::Application, Dancer and Catalyst communities. gvim From zzz at zzz.org.ua Wed May 25 04:52:46 2011 From: zzz at zzz.org.ua (Alexandr Gomoliako) Date: Wed, 25 May 2011 03:52:46 +0300 Subject: Cache problem? In-Reply-To: <4DDC4707.5030708@gmail.com> References: <4DDC3C35.5080400@gmail.com> <4DDC4707.5030708@gmail.com> Message-ID: On 5/25/11, gvim wrote: > Of the ones you've listed Starman is the more established. > My ngxing vhosts file has this kind of setup: There is nothing wrong with your nginx setup. So there is a good chance that either PSGI server or your application does this. From gvimrc at gmail.com Wed May 25 05:02:48 2011 From: gvimrc at gmail.com (gvim) Date: Wed, 25 May 2011 02:02:48 +0100 Subject: Cache problem? In-Reply-To: References: <4DDC3C35.5080400@gmail.com> <4DDC4707.5030708@gmail.com> Message-ID: <4DDC5538.1050503@gmail.com> On 25/05/2011 01:52, Alexandr Gomoliako wrote: > > There is nothing wrong with your nginx setup. So there is a good > chance that either PSGI server or your application does this. > I just switched it to nginx + FastCGI/cgi-wrap.pl and it ran consistently without errors but was dog slow compared with plain vanilla Apache/CGI. Don't get it. gvim From sbc19861004 at gmail.com Wed May 25 07:38:17 2011 From: sbc19861004 at gmail.com (eagle sbc) Date: Wed, 25 May 2011 11:38:17 +0800 Subject: SSI include infinite loop In-Reply-To: <20110524125901.GW42265@mdounin.ru> References: <20110524125901.GW42265@mdounin.ru> Message-ID: Hello, Thanks for your reply! And I think the limit on the number is proper for most of the conditions. However in our case, the index page may have hundreds of SSI 'include' (combined from lots of our sub sites), and the number limitation may not be so proper. So here I made a patch: For every 'include', a 'parents uri check' is made. The patch is like this: diff -crB nginx-0.7.65.org/src/http/modules/ngx_http_ssi_filter_module.cnginx-0.7.65.patch/src/http/modules/ngx_http_ssi_filter_module.c *** nginx-0.7.65.org/src/http/modules/ngx_http_ssi_filter_module.c 2011-05-24 18:46:53.676370002 +0800 --- nginx-0.7.65.patch/src/http/modules/ngx_http_ssi_filter_module.c 2011-05-25 11:19:20.372370002 +0800 *************** *** 2024,2029 **** --- 2024,2044 ---- flags |= NGX_HTTP_SUBREQUEST_IN_MEMORY|NGX_HTTP_SUBREQUEST_WAITED; } + ngx_http_request_t *ir = r; + for(;ir != NULL;ir = ir->parent) { + ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + " include path: %V, args: %V; parent path: %V, args: %V", + uri, &args, &ir->uri, &ir->args); + if (uri->len == ir->uri.len + && args.len == ir->args.len + && ngx_strncmp(uri->data, ir->uri.data, uri->len) == 0 + && ngx_strncmp(args.data, ir->args.data, args.len) == 0) { + ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, + "A loop include \"%V\" is found", uri); + return NGX_HTTP_SSI_ERROR; + } + } + if (ngx_http_subrequest(r, uri, &args, &sr, psr, flags) != NGX_OK) { return NGX_HTTP_SSI_ERROR; } Hope for any reply of my patch ! And thanks to my fellow ??? for reminding me on the 'args' check! On Tue, May 24, 2011 at 8:59 PM, Maxim Dounin wrote: > Hello! > > On Tue, May 24, 2011 at 10:49:45AM +0800, eagle sbc wrote: > > > Hello, > > > > I've encountered a problem about "SSI include infinite loop". > > > > We have a system that our editors can compose a html page from some > > templates using SSI. Sometimes unwarily combination will cause infinite > > loop, such as 'A include A', 'A include B, B include A', or even 'A > include > > B, B include C, C include A'. And this page will cause nginx eating up > all > > memories, and certainly won't serve any more unless we restart nginx. > > > > I'm wondering is there any solution for this problem? Or other ways to > avoid > > this? > > > > I've googled apache and lighttpd, and there also no official solution for > > this, unless lightptd has a patch which will limit the whole 'include' > > count, and I think it's just a tricky way to fix the infinite loop. > > > > Thanks a lot for any help! > > Number of in-flight ssi includes used to be limited in nginx, > though this limit was broken somewhere near 0.7.25. > > This patch brings it back: > > http://nginx.org/pipermail/nginx-devel/2011-February/000746.html > > Maxim Dounin > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -- ??????????????????? ?????????????????????????? ??????? ?????????????? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffrpang at gmail.com Wed May 25 09:10:54 2011 From: jeffrpang at gmail.com (Jeff Pang) Date: Wed, 25 May 2011 13:10:54 +0800 Subject: clean nginx log Message-ID: Hello, I'm not sure, is it just right to truncate the nginx's access log by: echo -n > /path/to/log/access.log Thanks. -- Jeff Pang www.DNSbed.com From igor at sysoev.ru Wed May 25 09:38:17 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 25 May 2011 09:38:17 +0400 Subject: clean nginx log In-Reply-To: References: Message-ID: <20110525053817.GD59490@sysoev.ru> On Wed, May 25, 2011 at 01:10:54PM +0800, Jeff Pang wrote: > Hello, > > I'm not sure, is it just right to truncate the nginx's access log by: > > echo -n > /path/to/log/access.log nginx uses O_APPEND flag for access log, so this trick may work. There is however, a more safer way: rm access.log kill -USR1 `cat /path/to/nginx.pid` -- Igor Sysoev From igor at sysoev.ru Wed May 25 10:13:48 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 25 May 2011 10:13:48 +0400 Subject: Provide site-specific SSL cert on behalf of clients In-Reply-To: References: Message-ID: <20110525061348.GF59490@sysoev.ru> On Tue, May 24, 2011 at 05:04:11PM -0400, urschrei wrote: > I'm wondering if I can configure nginx to provide a PEM SSL cert for a > specific site on behalf of clients on my subnet, and how I might go > about configuring, testing this. I have a cert in PEM format, and nginx > 0.8.54 with SSL support, running on Ubuntu 11.04. Do you mean a cetificate that a client passes to a server or what ? -- Igor Sysoev From jeffrpang at gmail.com Wed May 25 10:24:40 2011 From: jeffrpang at gmail.com (Jeff Pang) Date: Wed, 25 May 2011 14:24:40 +0800 Subject: clean nginx log In-Reply-To: <20110525053817.GD59490@sysoev.ru> References: <20110525053817.GD59490@sysoev.ru> Message-ID: 2011/5/25 Igor Sysoev : > > nginx uses O_APPEND flag for access log, so this trick may work. > There is however, a more safer way: > > rm access.log > kill -USR1 `cat /path/to/nginx.pid` > > That's right. Thanks Igor. -- Jeff Pang www.DNSbed.com From nginx-forum at nginx.us Wed May 25 13:15:18 2011 From: nginx-forum at nginx.us (urschrei) Date: Wed, 25 May 2011 05:15:18 -0400 Subject: Provide site-specific SSL cert on behalf of clients In-Reply-To: <20110525061348.GF59490@sysoev.ru> References: <20110525061348.GF59490@sysoev.ru> Message-ID: <98641453b4bf34b5f9f3b17d98af2f22.NginxMailingListEnglish@forum.nginx.org> Igor, yes, it's a client SSL cert. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200521,200646#msg-200646 From igor at sysoev.ru Wed May 25 13:19:57 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 25 May 2011 13:19:57 +0400 Subject: Provide site-specific SSL cert on behalf of clients In-Reply-To: <98641453b4bf34b5f9f3b17d98af2f22.NginxMailingListEnglish@forum.nginx.org> References: <20110525061348.GF59490@sysoev.ru> <98641453b4bf34b5f9f3b17d98af2f22.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110525091957.GB83054@sysoev.ru> On Wed, May 25, 2011 at 05:15:18AM -0400, urschrei wrote: > Igor, > yes, it's a client SSL cert. You should have a CA certificate which is used to sign client certificates. This ceritificate should be declared on server level: server { listen 443; ssl on; ... ssl_client_certificate ca-cert.pem; ssl_verify_client on; -- Igor Sysoev From nginx-forum at nginx.us Wed May 25 13:41:14 2011 From: nginx-forum at nginx.us (Trazzt) Date: Wed, 25 May 2011 05:41:14 -0400 Subject: Configuring phpmyadmin In-Reply-To: References: Message-ID: Okay thx for the tip I'm new to this ;) Here it is: phpmyadmin: _____________________________________ server{ listen 80; server_name phpmyadmin; access_log /var/log/phpmyadmin.access_log; error_log /var/log/phpmyadmin.error_log; location / { root /usr/share/phpmyadmin; index index.php; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/phpmyadmin$fastcgi_script_name; include fastcgi_params; } } _____________________________________ This is my fastcgi_script, located at "/etc/init.d/php-fastcgi" http://pastie.org/1970419 I also have one other site enabled, I don't know if thats relevant but you can find it here. I want this site to be located at 'localhost' http://pastie.org/1970411 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200488,200656#msg-200656 From igor at sysoev.ru Wed May 25 13:45:48 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 25 May 2011 13:45:48 +0400 Subject: Configuring phpmyadmin In-Reply-To: References: Message-ID: <20110525094548.GD83054@sysoev.ru> On Wed, May 25, 2011 at 05:41:14AM -0400, Trazzt wrote: > Okay thx for the tip I'm new to this ;) > Here it is: > > phpmyadmin: > _____________________________________ > server{ > listen 80; > server_name phpmyadmin; > access_log /var/log/phpmyadmin.access_log; > error_log /var/log/phpmyadmin.error_log; > > location / { > root /usr/share/phpmyadmin; > index index.php; > } > > location ~ \.php$ { > fastcgi_pass 127.0.0.1:9000; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME > /usr/share/phpmyadmin$fastcgi_script_name; > include fastcgi_params; > } > } > _____________________________________ > > This is my fastcgi_script, located at "/etc/init.d/php-fastcgi" > http://pastie.org/1970419 > > > I also have one other site enabled, I don't know if thats relevant but > you can find it here. > I want this site to be located at 'localhost' > http://pastie.org/1970411 You probably need location / { return 404; } location /phpmyadmin { root /usr/share; index index.php; } location ~ ^/phpmyadmin/\.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME /usr/share$fastcgi_script_name; include fastcgi_params; } -- Igor Sysoev From nginx-forum at nginx.us Wed May 25 13:48:26 2011 From: nginx-forum at nginx.us (speedfirst) Date: Wed, 25 May 2011 05:48:26 -0400 Subject: How to add an arg to the requests to the upstreams Message-ID: Hey, I wanna add a custom arg to the upstreams by proxy_pass like this: upstream servers { server1:8011; server2:8012; } ... server { listen on 8443; ssl on; server_name server0; location / { proxy_pass https://servers; } } My expectation: type "https://server0:8443" and the upstream will get "https://server1:8011?abc=1" So how can I make this? Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200661,200661#msg-200661 From igor at sysoev.ru Wed May 25 13:54:25 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 25 May 2011 13:54:25 +0400 Subject: How to add an arg to the requests to the upstreams In-Reply-To: References: Message-ID: <20110525095425.GE83054@sysoev.ru> On Wed, May 25, 2011 at 05:48:26AM -0400, speedfirst wrote: > Hey, I wanna add a custom arg to the upstreams by proxy_pass like this: > > upstream servers { > server1:8011; > server2:8012; > } > > ... > server { > listen on 8443; > ssl on; > server_name server0; > location / { > proxy_pass https://servers; > } > } > > > My expectation: type "https://server0:8443" and the upstream will get > "https://server1:8011?abc=1" > > So how can I make this? Thanks. proxy_pass https://servers$uri?abc=1; -- Igor Sysoev From nginx-forum at nginx.us Wed May 25 14:12:03 2011 From: nginx-forum at nginx.us (speedfirst) Date: Wed, 25 May 2011 06:12:03 -0400 Subject: How to add an arg to the requests to the upstreams In-Reply-To: References: Message-ID: <3746305b0f4b3659bdda38df5bdcd362.NginxMailingListEnglish@forum.nginx.org> Is direct pass OK, like this? proxy_pass https://servers?abc=1 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200661,200666#msg-200666 From nginx-forum at nginx.us Wed May 25 14:13:49 2011 From: nginx-forum at nginx.us (Trazzt) Date: Wed, 25 May 2011 06:13:49 -0400 Subject: Configuring phpmyadmin In-Reply-To: <20110525094548.GD83054@sysoev.ru> References: <20110525094548.GD83054@sysoev.ru> Message-ID: <1a34a17cc38e0ae28d7d2f29cbaad85f.NginxMailingListEnglish@forum.nginx.org> Thank you, that did the trick! Only I have a new problem now. PHP looks suddenly disabled I get a text file, when I visit: '127.0.0.1/phpmyadmin' Like this: http://postimage.org/image/2j6o8olyc/ I already tried to add the line: fastcgi_index index.php; and restarting nginx. That didn't work Rebooting also didn't help Do you know how I can enable PHP again? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200488,200667#msg-200667 From igor at sysoev.ru Wed May 25 14:25:21 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 25 May 2011 14:25:21 +0400 Subject: Configuring phpmyadmin In-Reply-To: <1a34a17cc38e0ae28d7d2f29cbaad85f.NginxMailingListEnglish@forum.nginx.org> References: <20110525094548.GD83054@sysoev.ru> <1a34a17cc38e0ae28d7d2f29cbaad85f.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110525102521.GF83054@sysoev.ru> On Wed, May 25, 2011 at 06:13:49AM -0400, Trazzt wrote: > Thank you, that did the trick! > Only I have a new problem now. PHP looks suddenly disabled > I get a text file, when I visit: '127.0.0.1/phpmyadmin' > Like this: > http://postimage.org/image/2j6o8olyc/ > > I already tried to add the line: > fastcgi_index index.php; > and restarting nginx. That didn't work You do not need this directive. > Rebooting also didn't help > > Do you know how I can enable PHP again? - location ~ ^/phpmyadmin/\.php$ { + location ~ ^/phpmyadmin/.+\.php$ { This is yet one of the reasons why I try to avoid as much as possible regex locations - too high mistake probability if you do not write or read a hundrend regexes a day. -- Igor Sysoev From igor at sysoev.ru Wed May 25 14:25:37 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 25 May 2011 14:25:37 +0400 Subject: How to add an arg to the requests to the upstreams In-Reply-To: <3746305b0f4b3659bdda38df5bdcd362.NginxMailingListEnglish@forum.nginx.org> References: <3746305b0f4b3659bdda38df5bdcd362.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110525102537.GG83054@sysoev.ru> On Wed, May 25, 2011 at 06:12:03AM -0400, speedfirst wrote: > Is direct pass OK, like this? > > proxy_pass https://servers?abc=1 No. -- Igor Sysoev From nginx-forum at nginx.us Wed May 25 14:27:15 2011 From: nginx-forum at nginx.us (urschrei) Date: Wed, 25 May 2011 06:27:15 -0400 Subject: Provide site-specific SSL cert on behalf of clients In-Reply-To: <20110525091957.GB83054@sysoev.ru> References: <20110525091957.GB83054@sysoev.ru> Message-ID: <1d3873fa52a49afa95a44b671017be50.NginxMailingListEnglish@forum.nginx.org> Igor, just to make sure I'm not misunderstanding you: Usually, what happens is this: I install an SSL cert (let's call it certA) in a client browser, so I can access https site A, which requires it. But if I have a lot of clients, I'd ideally like to have nginx proxy this cert, on behalf of my clients, so I don't have to install it for each of them. Are you saying that in order for nginx to proxy the cert, I'll first have to generate a CA cert on the server, and then sign the client cert (certA) with it? Won't this result in a self-signed certificate warning every time a client tries to access site A? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200521,200672#msg-200672 From igor at sysoev.ru Wed May 25 14:34:03 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 25 May 2011 14:34:03 +0400 Subject: Provide site-specific SSL cert on behalf of clients In-Reply-To: <1d3873fa52a49afa95a44b671017be50.NginxMailingListEnglish@forum.nginx.org> References: <20110525091957.GB83054@sysoev.ru> <1d3873fa52a49afa95a44b671017be50.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110525103403.GH83054@sysoev.ru> On Wed, May 25, 2011 at 06:27:15AM -0400, urschrei wrote: > Igor, > just to make sure I'm not misunderstanding you: > > Usually, what happens is this: > > I install an SSL cert (let's call it certA) in a client browser, so I > can access https site A, which requires it. > > But if I have a lot of clients, I'd ideally like to have nginx proxy > this cert, on behalf of my clients, so I don't have to install it for > each of them. Are you saying that in order for nginx to proxy the cert, > I'll first have to generate a CA cert on the server, and then sign the > client cert (certA) with it? Won't this result in a self-signed > certificate warning every time a client tries to access site A? nginx as a client does not currently support a client certificate when it proxies a request to HTTPS backend (B). However, I do not see any security advantage when many clients look like one for backend B. -- Igor Sysoev From nginx-forum at nginx.us Wed May 25 14:46:17 2011 From: nginx-forum at nginx.us (urschrei) Date: Wed, 25 May 2011 06:46:17 -0400 Subject: Provide site-specific SSL cert on behalf of clients In-Reply-To: <20110525103403.GH83054@sysoev.ru> References: <20110525103403.GH83054@sysoev.ru> Message-ID: > nginx as a client does not currently support a > client certificate > when it proxies a request to HTTPS backend (B). > However, I do not see > any security advantage when many clients look like > one for backend B. Thanks for clearing up the confusion. In this case, there would be no security advantage even if the cert were individually installed, since the same cert is issued to each client in the organisation, so whether the cert is proxied or not really makes no difference. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200521,200678#msg-200678 From igor at sysoev.ru Wed May 25 15:37:08 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 25 May 2011 15:37:08 +0400 Subject: Rewrite rule for nginx from Apache In-Reply-To: References: <6856e4d76e54e6ffbc66eaa7c05442ce.NginxMailingListEnglish@forum.nginx.org> <4afe9fa1984e2ca74c7636d2a379d417.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110525113708.GJ83054@sysoev.ru> On Mon, May 23, 2011 at 01:18:30PM -0400, the_traveller wrote: > Hi mr Igor > I'm sory coz i toke alittle bit too long > > so if i have to make any ngnix rule i have to make it like that by ex: > > location /Joke/ { > fastcgi_pass ... > fastcgi_param SCRIPT_FILENAME /jokes.php; > fastcgi_param QUERY_STRING $args; > ... > } > > and the Original Apache rule is > RewriteRule ^Joke/.* jokes.php [QSA] > > sposing that the script is in the public dir of the ftp > is my try right?? SCRIPT_FILENAME should point to a file, for example, /usr/www/scripts/jokes.php. > and also is the three dots in the second line > fastcgi_pass ... > and before the closing tag > ... > } > is this is right or i have to remove them ?? > > thanks alot for ur help > and if i have removed them dots means that you should add your specific paramters, that is, fastcgi_pass backend:9000; etc. -- Igor Sysoev From nginx-forum at nginx.us Wed May 25 15:43:54 2011 From: nginx-forum at nginx.us (chris.percol) Date: Wed, 25 May 2011 07:43:54 -0400 Subject: redirect subdomain to internal location Message-ID: <98b315ad9cc32b0957db3ff6074d4799.NginxMailingListEnglish@forum.nginx.org> How would I test for the following subdomains? www www4 any other subdomain Then redirect each to a corresponding internal location? I am using the following code to get the 'any other subdomain' but can't get the redirect to a location such as @any_subd working? if ($host ~* "(.*)\.tm2app\.com") { set $subd $1; } Thanks for your help. Chris Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200694,200694#msg-200694 From nginx-forum at nginx.us Wed May 25 15:58:21 2011 From: nginx-forum at nginx.us (Trazzt) Date: Wed, 25 May 2011 07:58:21 -0400 Subject: Configuring phpmyadmin In-Reply-To: <803a4e8efdcc2152348d257454089b78.NginxMailingListEnglish@forum.nginx.org> References: <803a4e8efdcc2152348d257454089b78.NginxMailingListEnglish@forum.nginx.org> Message-ID: <2939c25028e7d77fdd6ffa5fcf62a654.NginxMailingListEnglish@forum.nginx.org> I really appreciate your help, but PHP is still not working This is how my phpmyadmin configuration file looks like after all your edits: ________________________ server{ listen 80; server_name phpmyadmin; access_log /var/log/phpmyadmin.access_log; error_log /var/log/phpmyadmin.error_log; location / { return 404; } location /phpmyadmin { root /usr/share; index index.php; } location ~ ^/phpmyadmin/.+\.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME /usr/share$fastcgi_script_name; include fastcgi_params; } } ______________________ Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200488,200702#msg-200702 From appa at perusio.net Wed May 25 15:57:54 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Wed, 25 May 2011 12:57:54 +0100 Subject: redirect subdomain to internal location In-Reply-To: <98b315ad9cc32b0957db3ff6074d4799.NginxMailingListEnglish@forum.nginx.org> References: <98b315ad9cc32b0957db3ff6074d4799.NginxMailingListEnglish@forum.nginx.org> Message-ID: <87d3j7kn5p.wl%appa@perusio.net> On 25 Mai 2011 12h43 WEST, nginx-forum at nginx.us wrote: > How would I test for the following subdomains? > > www > www4 > any other subdomain > > Then redirect each to a corresponding internal location? > > I am using the following code to get the 'any other subdomain' but > can't get the redirect to a location such as @any_subd working? > > if ($host ~* "(.*)\.tm2app\.com") { > set $subd $1; > } Do you mean that *all* subdomains should use the same location? If so use a wildcard in the server_name directive: server { server_name *.tmp2app.com; (...) } If the subdomains always start by www and they're to be handled differently than other do this for www1, www2...www99 server { server_name "~^www\d{1,2}\.tmp2app\.com$"; (...) } --- appa > Thanks for your help. > > Chris > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,200694,200694#msg-200694 > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx From dick at fouter.net Wed May 25 16:04:44 2011 From: dick at fouter.net (Dick Middleton) Date: Wed, 25 May 2011 13:04:44 +0100 Subject: Configuring phpmyadmin In-Reply-To: <2939c25028e7d77fdd6ffa5fcf62a654.NginxMailingListEnglish@forum.nginx.org> References: <803a4e8efdcc2152348d257454089b78.NginxMailingListEnglish@forum.nginx.org> <2939c25028e7d77fdd6ffa5fcf62a654.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4DDCF05C.4010807@fouter.net> On 05/25/11 12:58, Trazzt wrote: > I really appreciate your help, but PHP is still not working > This is how my phpmyadmin configuration file looks like after all your > edits: > location ~ ^/phpmyadmin/.+\.php$ { > fastcgi_pass 127.0.0.1:9000; > fastcgi_param SCRIPT_FILENAME /usr/share$fastcgi_script_name; > include fastcgi_params; I found I had to use: fastcgi_param SCRIPT_FILENAME $request_filename; I don't really understand why. Dick From igor at sysoev.ru Wed May 25 16:48:50 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 25 May 2011 16:48:50 +0400 Subject: Configuring phpmyadmin In-Reply-To: <4DDCF05C.4010807@fouter.net> References: <803a4e8efdcc2152348d257454089b78.NginxMailingListEnglish@forum.nginx.org> <2939c25028e7d77fdd6ffa5fcf62a654.NginxMailingListEnglish@forum.nginx.org> <4DDCF05C.4010807@fouter.net> Message-ID: <20110525124850.GL83054@sysoev.ru> On Wed, May 25, 2011 at 01:04:44PM +0100, Dick Middleton wrote: > On 05/25/11 12:58, Trazzt wrote: > > I really appreciate your help, but PHP is still not working > > This is how my phpmyadmin configuration file looks like after all your > > edits: > > > location ~ ^/phpmyadmin/.+\.php$ { > > fastcgi_pass 127.0.0.1:9000; > > fastcgi_param SCRIPT_FILENAME /usr/share$fastcgi_script_name; > > include fastcgi_params; > > I found I had to use: > > fastcgi_param SCRIPT_FILENAME $request_filename; > > I don't really understand why. $request_filename is "$document_root$uri". -- ????? ?????? http://sysoev.ru From igor at sysoev.ru Wed May 25 16:50:03 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 25 May 2011 16:50:03 +0400 Subject: Configuring phpmyadmin In-Reply-To: <2939c25028e7d77fdd6ffa5fcf62a654.NginxMailingListEnglish@forum.nginx.org> References: <803a4e8efdcc2152348d257454089b78.NginxMailingListEnglish@forum.nginx.org> <2939c25028e7d77fdd6ffa5fcf62a654.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110525125003.GN83054@sysoev.ru> On Wed, May 25, 2011 at 07:58:21AM -0400, Trazzt wrote: > I really appreciate your help, but PHP is still not working What does it means - "PHP is still not working" ? > This is how my phpmyadmin configuration file looks like after all your > edits: > ________________________ > server{ > listen 80; > server_name phpmyadmin; > access_log /var/log/phpmyadmin.access_log; > error_log /var/log/phpmyadmin.error_log; > > location / { > return 404; > } > > location /phpmyadmin { > root /usr/share; > index index.php; > } > > location ~ ^/phpmyadmin/.+\.php$ { > fastcgi_pass 127.0.0.1:9000; > fastcgi_param SCRIPT_FILENAME /usr/share$fastcgi_script_name; > include fastcgi_params; > } > } > ______________________ -- ????? ?????? http://sysoev.ru From nginx-forum at nginx.us Wed May 25 17:07:30 2011 From: nginx-forum at nginx.us (Trazzt) Date: Wed, 25 May 2011 09:07:30 -0400 Subject: Configuring phpmyadmin In-Reply-To: <803a4e8efdcc2152348d257454089b78.NginxMailingListEnglish@forum.nginx.org> References: <803a4e8efdcc2152348d257454089b78.NginxMailingListEnglish@forum.nginx.org> Message-ID: <8ceb852c72ec1949f2d94c7ffe484bd9.NginxMailingListEnglish@forum.nginx.org> I mean I still get the text screen like in the image. I still get no layout, only the 'index.php' file in text format. Like in the screenshot: http://postimage.org/image/2j6o8olyc/ Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200488,200733#msg-200733 From igor at sysoev.ru Wed May 25 17:15:57 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 25 May 2011 17:15:57 +0400 Subject: Configuring phpmyadmin In-Reply-To: <8ceb852c72ec1949f2d94c7ffe484bd9.NginxMailingListEnglish@forum.nginx.org> References: <803a4e8efdcc2152348d257454089b78.NginxMailingListEnglish@forum.nginx.org> <8ceb852c72ec1949f2d94c7ffe484bd9.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110525131557.GR83054@sysoev.ru> On Wed, May 25, 2011 at 09:07:30AM -0400, Trazzt wrote: > I mean I still get the text screen like in the image. I still get no > layout, only the 'index.php' file in text format. > Like in the screenshot: > http://postimage.org/image/2j6o8olyc/ Try to add localhost and 127.0.0.1 to ensure that you request a right server: server{ listen 80; server_name phpmyadmin localhost 127.0.0.1; -- Igor Sysoev From nginx-forum at nginx.us Wed May 25 17:16:31 2011 From: nginx-forum at nginx.us (chris.percol) Date: Wed, 25 May 2011 09:16:31 -0400 Subject: redirect subdomain to internal location In-Reply-To: <87d3j7kn5p.wl%appa@perusio.net> References: <87d3j7kn5p.wl%appa@perusio.net> Message-ID: Thanks. No, I want www and ww4 to use different locations, with all other subdomains using another single location. Thanks again, Chris Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200694,200739#msg-200739 From igor at sysoev.ru Wed May 25 17:21:00 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 25 May 2011 17:21:00 +0400 Subject: redirect subdomain to internal location In-Reply-To: <98b315ad9cc32b0957db3ff6074d4799.NginxMailingListEnglish@forum.nginx.org> References: <98b315ad9cc32b0957db3ff6074d4799.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110525132100.GS83054@sysoev.ru> On Wed, May 25, 2011 at 07:43:54AM -0400, chris.percol wrote: > How would I test for the following subdomains? > > www > www4 > any other subdomain > > Then redirect each to a corresponding internal location? > > I am using the following code to get the 'any other subdomain' but can't > get the redirect to a location such as @any_subd working? > > if ($host ~* "(.*)\.tm2app\.com") { > set $subd $1; > } Could you describe using examples, but not "if/set" ? nginx virtual server names are described here: http://nginx.org/en/docs/http/server_names.html -- Igor Sysoev From appa at perusio.net Wed May 25 17:22:50 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Wed, 25 May 2011 14:22:50 +0100 Subject: redirect subdomain to internal location In-Reply-To: References: <87d3j7kn5p.wl%appa@perusio.net> Message-ID: <87boyqlxsl.wl%appa@perusio.net> On 25 Mai 2011 14h16 WEST, nginx-forum at nginx.us wrote: > Thanks. > > No, I want www and ww4 to use different locations, with all other > subdomains using another single location. server { server_name www.tmp2app.com; (...) # put one location here } server { server_name www4.tmp2app.com; (...) # put the other location here } server { server_name *.tmp2app.com; (...) # put the remaining here } --- appa From nginx-forum at nginx.us Wed May 25 17:34:57 2011 From: nginx-forum at nginx.us (Trazzt) Date: Wed, 25 May 2011 09:34:57 -0400 Subject: Configuring phpmyadmin In-Reply-To: <803a4e8efdcc2152348d257454089b78.NginxMailingListEnglish@forum.nginx.org> References: <803a4e8efdcc2152348d257454089b78.NginxMailingListEnglish@forum.nginx.org> Message-ID: <2ece37602602a6f14d386e970ca800fe.NginxMailingListEnglish@forum.nginx.org> I tried what you said, but I still get the text file. Thanks for all your support, I'm gonna reinstall phpmyadmin completely using the configuration files you supplied. I used this tutorial to install nginx + phpmyadmin, I'll search for another tut. http://joneslee85.wordpress.com/2010/02/28/howto-nginx-php5-mysql-phpmyadmin-ubuntu-shortest-setup/ Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200488,200751#msg-200751 From igor at sysoev.ru Wed May 25 17:36:29 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 25 May 2011 17:36:29 +0400 Subject: Configuring phpmyadmin In-Reply-To: <2ece37602602a6f14d386e970ca800fe.NginxMailingListEnglish@forum.nginx.org> References: <803a4e8efdcc2152348d257454089b78.NginxMailingListEnglish@forum.nginx.org> <2ece37602602a6f14d386e970ca800fe.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110525133629.GT83054@sysoev.ru> On Wed, May 25, 2011 at 09:34:57AM -0400, Trazzt wrote: > I tried what you said, but I still get the text file. > > Thanks for all your support, I'm gonna reinstall phpmyadmin completely > using the configuration files you supplied. > > I used this tutorial to install nginx + phpmyadmin, I'll search for > another tut. > http://joneslee85.wordpress.com/2010/02/28/howto-nginx-php5-mysql-phpmyadmin-ubuntu-shortest-setup/ Could you create debug log of the request ? http://nginx.org/en/docs/debugging_log.html -- Igor Sysoev From dick at fouter.net Wed May 25 17:56:07 2011 From: dick at fouter.net (Dick Middleton) Date: Wed, 25 May 2011 14:56:07 +0100 Subject: Configuring phpmyadmin In-Reply-To: <2939c25028e7d77fdd6ffa5fcf62a654.NginxMailingListEnglish@forum.nginx.org> References: <803a4e8efdcc2152348d257454089b78.NginxMailingListEnglish@forum.nginx.org> <2939c25028e7d77fdd6ffa5fcf62a654.NginxMailingListEnglish@forum.nginx.org> Message-ID: <4DDD0A77.9000208@fouter.net> On 05/25/11 12:58, Trazzt wrote: > I really appreciate your help, but PHP is still not working > This is how my phpmyadmin configuration file looks like after all your > edits: > ________________________ > server{ > listen 80; > server_name phpmyadmin; > access_log /var/log/phpmyadmin.access_log; > error_log /var/log/phpmyadmin.error_log; > > location / { > return 404; > } > > location /phpmyadmin { > root /usr/share; > index index.php; > } > > location ~ ^/phpmyadmin/.+\.php$ { > fastcgi_pass 127.0.0.1:9000; > fastcgi_param SCRIPT_FILENAME /usr/share$fastcgi_script_name; > include fastcgi_params; > } > } I'm not sure which location /phpmyadmin/ is served from. If it's the first, as I suspect, then there's no way index.php is going to be processed. I would use: location /phpmyadmin { index index.php; ... location ~ \.php$ { ... } } No? Dick From igor at sysoev.ru Wed May 25 18:00:48 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 25 May 2011 18:00:48 +0400 Subject: Configuring phpmyadmin In-Reply-To: <4DDD0A77.9000208@fouter.net> References: <803a4e8efdcc2152348d257454089b78.NginxMailingListEnglish@forum.nginx.org> <2939c25028e7d77fdd6ffa5fcf62a654.NginxMailingListEnglish@forum.nginx.org> <4DDD0A77.9000208@fouter.net> Message-ID: <20110525140048.GU83054@sysoev.ru> On Wed, May 25, 2011 at 02:56:07PM +0100, Dick Middleton wrote: > On 05/25/11 12:58, Trazzt wrote: > > I really appreciate your help, but PHP is still not working > > This is how my phpmyadmin configuration file looks like after all your > > edits: > > ________________________ > > server{ > > listen 80; > > server_name phpmyadmin; > > access_log /var/log/phpmyadmin.access_log; > > error_log /var/log/phpmyadmin.error_log; > > > > location / { > > return 404; > > } > > > > location /phpmyadmin { > > root /usr/share; > > index index.php; > > } > > > > location ~ ^/phpmyadmin/.+\.php$ { > > fastcgi_pass 127.0.0.1:9000; > > fastcgi_param SCRIPT_FILENAME /usr/share$fastcgi_script_name; > > include fastcgi_params; > > } > > } > > I'm not sure which location /phpmyadmin/ is served from. If it's the > first, as I suspect, then there's no way index.php is going to be processed. > > I would use: > > location /phpmyadmin { > index index.php; > ... > > location ~ \.php$ { > ... > } > } > > No? Yes, inclusive "location ~ \.php$" is much better than configuration I suggested. However, my configuration should also work, since /phpmyadmin/ is internally redirected to /phpmyadmin/index.php, see for details: http://nginx.org/en/docs/http/request_processing.html#simple_php_site_configuration -- Igor Sysoev From nginx-forum at nginx.us Wed May 25 18:26:42 2011 From: nginx-forum at nginx.us (chris.percol) Date: Wed, 25 May 2011 10:26:42 -0400 Subject: redirect subdomain to internal location In-Reply-To: <98b315ad9cc32b0957db3ff6074d4799.NginxMailingListEnglish@forum.nginx.org> References: <98b315ad9cc32b0957db3ff6074d4799.NginxMailingListEnglish@forum.nginx.org> Message-ID: <30128c32f2b4ce211f2854f9ef451967.NginxMailingListEnglish@forum.nginx.org> Thanks guys, I get that now, in my newness to nginx I was overcomplicating things. My server_name is now doing what I had hoped to achieve. If you can bear with me for one more question, how do I get the 'client' out of domain.com/client/more/stuff.htm? I want to use the 'client' part of the uri to search a redis key/value pair. I had success with this code for query strings but couldn't work out how to get the first part of the uri to be my key? location / { eval_escalate on; eval $res { set_unescape_uri $key $arg_key; redis2_query get $key; redis2_pass 127.0.0.1:6379; } set_by_lua $path "return require('redis.parser').parse_reply(ngx.arg[1])" $res; proxy_pass http://app_cluster_1/$path; proxy_redirect off; } Thanks again for all the help! Chris Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200694,200774#msg-200774 From nginx-forum at nginx.us Wed May 25 18:38:56 2011 From: nginx-forum at nginx.us (Trazzt) Date: Wed, 25 May 2011 10:38:56 -0400 Subject: Configuring phpmyadmin In-Reply-To: <20110525140048.GU83054@sysoev.ru> References: <20110525140048.GU83054@sysoev.ru> Message-ID: <5fbdb16d9c5bea48f084b81fc00a688d.NginxMailingListEnglish@forum.nginx.org> Igor Sysoev Wrote: ------------------------------------------------------- > On Wed, May 25, 2011 at 02:56:07PM +0100, Dick > Middleton wrote: > > On 05/25/11 12:58, Trazzt wrote: > > > I really appreciate your help, but PHP is > still not working > > > This is how my phpmyadmin configuration file > looks like after all your > > > edits: > > > ________________________ > > > server{ > > > listen 80; > > > server_name phpmyadmin; > > > access_log > /var/log/phpmyadmin.access_log; > > > error_log /var/log/phpmyadmin.error_log; > > > > > > location / { > > > return 404; > > > } > > > > > > location /phpmyadmin { > > > root /usr/share; > > > index index.php; > > > } > > > > > > location ~ ^/phpmyadmin/.+\.php$ { > > > fastcgi_pass 127.0.0.1:9000; > > > fastcgi_param SCRIPT_FILENAME > /usr/share$fastcgi_script_name; > > > include fastcgi_params; > > > } > > > } > > > > I'm not sure which location /phpmyadmin/ is > served from. If it's the > > first, as I suspect, then there's no way > index.php is going to be processed. > > > > I would use: > > > > location /phpmyadmin { > > index index.php; > > ... > > > > location ~ \.php$ { > > ... > > } > > } > > > > No? > > Yes, inclusive "location ~ \.php$" is much better > than configuration > I suggested. > > However, my configuration should also work, since > /phpmyadmin/ is > internally redirected to /phpmyadmin/index.php, > see for details: > http://nginx.org/en/docs/http/request_processing.h > tml#simple_php_site_configuration > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx I'm trying to explain to you why I can't debug the file, but the forum says Possible hack attempt detected. The posted form data was rejected. I'm having trouble running the "./configure" command, when I try to run it in terminal When I uninstalled nginx, somehow apache2 started, while I never installed apache2 I couldn't uninstall apache, because only the apache2 service was on my pc, and no installation files. Maybe this is causing the nginx errors. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200488,200779#msg-200779 From igor at sysoev.ru Wed May 25 18:42:06 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 25 May 2011 18:42:06 +0400 Subject: Configuring phpmyadmin In-Reply-To: <5fbdb16d9c5bea48f084b81fc00a688d.NginxMailingListEnglish@forum.nginx.org> References: <20110525140048.GU83054@sysoev.ru> <5fbdb16d9c5bea48f084b81fc00a688d.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110525144205.GV83054@sysoev.ru> > I'm trying to explain to you why I can't debug the file, but the forum > says > Possible hack attempt detected. The posted form data was rejected. The forum is a gateway to mailing list: http://nginx.org/mailman/listinfo/nginx You may write there. -- Igor Sysoev From appa at perusio.net Wed May 25 19:07:11 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Wed, 25 May 2011 16:07:11 +0100 Subject: redirect subdomain to internal location In-Reply-To: <30128c32f2b4ce211f2854f9ef451967.NginxMailingListEnglish@forum.nginx.org> References: <98b315ad9cc32b0957db3ff6074d4799.NginxMailingListEnglish@forum.nginx.org> <30128c32f2b4ce211f2854f9ef451967.NginxMailingListEnglish@forum.nginx.org> Message-ID: <87aaealsyo.wl%appa@perusio.net> On 25 Mai 2011 15h26 WEST, nginx-forum at nginx.us wrote: > Thanks guys, > > I get that now, in my newness to nginx I was overcomplicating > things. My server_name is now doing what I had hoped to achieve. > > If you can bear with me for one more question, how do I get the > 'client' out of domain.com/client/more/stuff.htm? I want to use the > 'client' part of the uri to search a redis key/value pair. > > I had success with this code for query strings but couldn't work out > how to get the first part of the uri to be my key? > > location / { > eval_escalate on; > eval $res { > set_unescape_uri $key $arg_key; > redis2_query get $key; > redis2_pass 127.0.0.1:6379; > } > set_by_lua $path "return > require('redis.parser').parse_reply(ngx.arg[1])" $res; > proxy_pass http://app_cluster_1/$path; > proxy_redirect off; > } If I'm understanding correctly what you want to do, you'll need a location with a regex that captures that URI component. E.g.: location /(?[^/]*)/ { (...) set_unescape_uri $key $client_key; (...) } This will match all URIs of the form /whatever/anything --- appa From appa at perusio.net Wed May 25 19:16:28 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Wed, 25 May 2011 16:16:28 +0100 Subject: redirect subdomain to internal location In-Reply-To: <87aaealsyo.wl%appa@perusio.net> References: <98b315ad9cc32b0957db3ff6074d4799.NginxMailingListEnglish@forum.nginx.org> <30128c32f2b4ce211f2854f9ef451967.NginxMailingListEnglish@forum.nginx.org> <87aaealsyo.wl%appa@perusio.net> Message-ID: <878vtulsj7.wl%appa@perusio.net> On 25 Mai 2011 16h07 WEST, appa at perusio.net wrote: Oops. > If I'm understanding correctly what you want to do, you'll need a > location with a regex that captures that URI component. E.g.: > > location /(?[^/]*)/ { > (...) set_unescape_uri $key $clientkey; ^^^^^^^^^^ Now it's correct. > (...) > } --- appa From appa at perusio.net Wed May 25 19:20:40 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Wed, 25 May 2011 16:20:40 +0100 Subject: redirect subdomain to internal location In-Reply-To: <30128c32f2b4ce211f2854f9ef451967.NginxMailingListEnglish@forum.nginx.org> References: <98b315ad9cc32b0957db3ff6074d4799.NginxMailingListEnglish@forum.nginx.org> <30128c32f2b4ce211f2854f9ef451967.NginxMailingListEnglish@forum.nginx.org> Message-ID: <877h9elsc7.wl%appa@perusio.net> On 25 Mai 2011 15h26 WEST, nginx-forum at nginx.us wrote: > Thanks guys, > > I get that now, in my newness to nginx I was overcomplicating > things. My server_name is now doing what I had hoped to achieve. > > If you can bear with me for one more question, how do I get the > 'client' out of domain.com/client/more/stuff.htm? I want to use the > 'client' part of the uri to search a redis key/value pair. > > I had success with this code for query strings but couldn't work out > how to get the first part of the uri to be my key? > > location / { > eval_escalate on; > eval $res { > set_unescape_uri $key $arg_key; > redis2_query get $key; > redis2_pass 127.0.0.1:6379; > } > set_by_lua $path "return > require('redis.parser').parse_reply(ngx.arg[1])" $res; > proxy_pass http://app_cluster_1/$path; > proxy_redirect off; > } If I'm understanding correctly what you want to do, you'll need a location with a regex that captures that URI component. E.g.: location ~ /(?[^/]*)/ { (...) set_unescape_uri $key $clientkey; (...) } This will match all URIs of the form /whatever/anything Forgot the little detail of the ~ for a regex based location. Now it seems correct. --- appa From igor at sysoev.ru Wed May 25 19:24:53 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Wed, 25 May 2011 19:24:53 +0400 Subject: nginx-1.0.3 Message-ID: <20110525152453.GY83054@sysoev.ru> Changes with nginx 1.0.3 25 May 2011 *) Feature: the "auth_basic_user_file" directive supports "$apr1", "{PLAIN}", and "{SSHA}" password encryption methods. Thanks to Maxim Dounin. *) Feature: the "geoip_org" directive and $geoip_org variable. Thanks to Alexander Uskov, Arnaud Granal, and Denis F. Latypoff. *) Feature: ngx_http_geo_module and ngx_http_geoip_module support IPv4 addresses mapped to IPv6 addresses. *) Bugfix: a segmentation fault occurred in a worker process during testing IPv4 address mapped to IPv6 address, if access or deny rules were defined only for IPv6; the bug had appeared in 0.8.22. *) Bugfix: a cached reponse may be broken if proxy/fastcgi/scgi/ uwsgi_cache_bypass and proxy/fastcgi/scgi/uwsgi_no_cache directive values were different; the bug had appeared in 0.8.46. -- Igor Sysoev From nginx-forum at nginx.us Wed May 25 22:14:52 2011 From: nginx-forum at nginx.us (chris.percol) Date: Wed, 25 May 2011 14:14:52 -0400 Subject: redirect subdomain to internal location In-Reply-To: <877h9elsc7.wl%appa@perusio.net> References: <877h9elsc7.wl%appa@perusio.net> Message-ID: <847822c57ab3d34c8cabbf63d58af5aa.NginxMailingListEnglish@forum.nginx.org> Ant?nio P. P. Almeida Wrote: ------------------------------------------------------- > On 25 Mai 2011 15h26 WEST, nginx-forum at nginx.us > wrote: > > > Thanks guys, > > > > I get that now, in my newness to nginx I was > overcomplicating > > things. My server_name is now doing what I had > hoped to achieve. > > > > If you can bear with me for one more question, > how do I get the > > 'client' out of > domain.com/client/more/stuff.htm? I want to use > the > > 'client' part of the uri to search a redis > key/value pair. > > > > I had success with this code for query strings > but couldn't work out > > how to get the first part of the uri to be my > key? > > > > location / { > > eval_escalate on; > > eval $res { > > set_unescape_uri $key $arg_key; > > redis2_query get $key; > > redis2_pass 127.0.0.1:6379; > > } > > set_by_lua $path "return > > require('redis.parser').parse_reply(ngx.arg[1])" > $res; > > proxy_pass http://app_cluster_1/$path; > > proxy_redirect off; > > } > > If I'm understanding correctly what you want to > do, you'll need a > location with a regex that captures that URI > component. E.g.: > > location ~ /(?[^/]*)/ { Appa, Thanks again! My issue is that I don't know the value of clientkey, it could be several hundred possibilities. Is there a way to extract the unknown clientkey from /clientkey/some/more.htm? Many thanks, Chris > (...) > set_unescape_uri $key $clientkey; > (...) > } > > This will match all URIs of the form > /whatever/anything > > Forgot the little detail of the ~ for a regex > based location. Now it > seems correct. > > --- appa > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200694,200846#msg-200846 From nginx-forum at nginx.us Wed May 25 22:30:28 2011 From: nginx-forum at nginx.us (the_traveller) Date: Wed, 25 May 2011 14:30:28 -0400 Subject: Rewrite rule for nginx from Apache In-Reply-To: <20110525113708.GJ83054@sysoev.ru> References: <20110525113708.GJ83054@sysoev.ru> Message-ID: I know i'm alittle bit annoying but can you show me how i must write the rule the path of the script jokes.php is in the public_html dir and it should talks the args like that jokes.php?j=$1 so in Apache i used to make the rule like that RewriteRule ^Joke/.* jokes.php [QSA] but i alwayes have the sever error on all of my tries Posted at Nginx Forum: http://forum.nginx.org/read.php?2,23868,200852#msg-200852 From appa at perusio.net Wed May 25 23:01:30 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Wed, 25 May 2011 20:01:30 +0100 Subject: redirect subdomain to internal location In-Reply-To: <847822c57ab3d34c8cabbf63d58af5aa.NginxMailingListEnglish@forum.nginx.org> References: <877h9elsc7.wl%appa@perusio.net> <847822c57ab3d34c8cabbf63d58af5aa.NginxMailingListEnglish@forum.nginx.org> Message-ID: <8762oyli45.wl%appa@perusio.net> On 25 Mai 2011 19h14 WEST, nginx-forum at nginx.us wrote: >> location ~ /(?[^/]*)/ { > > Appa, > > Thanks again! > > My issue is that I don't know the value of clientkey, it could be > several hundred possibilities. > > Is there a way to extract the unknown clientkey from > /clientkey/some/more.htm? > > Many thanks, That's completely generic. It's a named group that captures any char excepting '/'. This implicitly creates a variable $clientkey that you can use. Try it. --- appa From nginx-forum at nginx.us Thu May 26 02:24:01 2011 From: nginx-forum at nginx.us (speedfirst) Date: Wed, 25 May 2011 18:24:01 -0400 Subject: How to add an arg to the requests to the upstreams In-Reply-To: <20110525102537.GG83054@sysoev.ru> References: <20110525102537.GG83054@sysoev.ru> Message-ID: <91282731f6854359868c392332b842cc.NginxMailingListEnglish@forum.nginx.org> So how to do that? Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200661,200920#msg-200920 From nginx-forum at nginx.us Thu May 26 02:28:09 2011 From: nginx-forum at nginx.us (speedfirst) Date: Wed, 25 May 2011 18:28:09 -0400 Subject: How to add an arg to the requests to the upstreams In-Reply-To: <91282731f6854359868c392332b842cc.NginxMailingListEnglish@forum.nginx.org> References: <20110525102537.GG83054@sysoev.ru> <91282731f6854359868c392332b842cc.NginxMailingListEnglish@forum.nginx.org> Message-ID: <0b232b6e659e6e32dda813e1f9691549.NginxMailingListEnglish@forum.nginx.org> sorry, ignore the last pst. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200661,200924#msg-200924 From nginx-forum at nginx.us Thu May 26 02:41:46 2011 From: nginx-forum at nginx.us (speedfirst) Date: Wed, 25 May 2011 18:41:46 -0400 Subject: How to make a redirect via programming? Message-ID: Hey, I'm making a custom module and need to send back the redirect response to the client. It should behave like the "sendRedirect" in java servlet programming. So which function is that API? Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200929,200929#msg-200929 From nginx-forum at nginx.us Thu May 26 02:57:25 2011 From: nginx-forum at nginx.us (phil1886) Date: Wed, 25 May 2011 18:57:25 -0400 Subject: Location directive disaster Message-ID: <63308ba80e89b53b19c992ed504da4a6.NginxMailingListEnglish@forum.nginx.org> Hi everyone I have moved from Apache2 to Nginx. I am finding it difficult working out what is going on with the location directive. I've looked at various tutorials and blogs but I'm still encountering problems. Basically I have a new website that I'm hosting off a directory of the current one. Lets call it /newwebsite. To prevent people getting to it, I've put http-basic authentication around it: ## Default Location location / { index index.php index.html; } location /newwebsite { index index.php index.html; auth_basic "Unauthorised use prohibited"; auth_basic_user_file /home/username/www.website.com/.htpasswd; } There's an admin section as well. I will need http authentication on this, even when it goes live, to stop people gaining access to the admin function: location /newwebsite/admin { index login.php; auth_basic "Unauthorised use prohibited"; auth_basic_user_file /home/username/www.website.com/.htpasswd; } Of course I have the catch-all for all the php scripts: location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; } So: When I visit http://domain.com/newsite/admin I get prompted for a http basic-auth username and password - as expected. This works. When I visit http://domain.com/newsite/admin/admin.php I am straight in without http basic-auth. This is not so good..!! So perhaps I'm doing this all wrong? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200935,200935#msg-200935 From nginx-forum at nginx.us Thu May 26 03:14:59 2011 From: nginx-forum at nginx.us (speedfirst) Date: Wed, 25 May 2011 19:14:59 -0400 Subject: How to make a redirect via programming? In-Reply-To: References: Message-ID: <15238faaa7505eea2c561c97cdb9dade.NginxMailingListEnglish@forum.nginx.org> is this OK? r->headers_out.status = NGX_HTTP_REDIRECT; r->headers_out.content_length_n = 0; ... // the code set "Location" header ngx_http_send_header(r); Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200929,200937#msg-200937 From tomlove at gmail.com Thu May 26 03:15:34 2011 From: tomlove at gmail.com (Thomas Love) Date: Thu, 26 May 2011 01:15:34 +0200 Subject: Location directive disaster In-Reply-To: <63308ba80e89b53b19c992ed504da4a6.NginxMailingListEnglish@forum.nginx.org> References: <63308ba80e89b53b19c992ed504da4a6.NginxMailingListEnglish@forum.nginx.org> Message-ID: On 26 May 2011 00:57, phil1886 wrote: > Hi everyone > > Hi. > location /newwebsite/admin { > index login.php; > auth_basic "Unauthorised use > prohibited"; > auth_basic_user_file > /home/username/www.website.com/.htpasswd; > > } > > Of course I have the catch-all for all the php scripts: > > location ~ \.php$ { > include /etc/nginx/fastcgi_params; > fastcgi_pass 127.0.0.1:9000; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME > $document_root$fastcgi_script_name; > fastcgi_param PATH_INFO > $fastcgi_script_name; > } > > > When I visit http://domain.com/newsite/admin/admin.php I am straight in > without http basic-auth. This is not so good..!! > > You have to put a copy of the ~ \.php$ location block inside the protected location block (nested), otherwise the php block takes precedence and the location parser does not match anything else. I had exactly the same problem: http://forum.nginx.org/read.php?2,189220 Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Thu May 26 03:41:45 2011 From: nginx-forum at nginx.us (phil1886) Date: Wed, 25 May 2011 19:41:45 -0400 Subject: Location directive disaster In-Reply-To: <63308ba80e89b53b19c992ed504da4a6.NginxMailingListEnglish@forum.nginx.org> References: <63308ba80e89b53b19c992ed504da4a6.NginxMailingListEnglish@forum.nginx.org> Message-ID: <272c8a57b15ed7b85fff2242876dc9ad.NginxMailingListEnglish@forum.nginx.org> Thank you!! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200935,200942#msg-200942 From nginx-forum at nginx.us Thu May 26 04:39:15 2011 From: nginx-forum at nginx.us (wyatt) Date: Wed, 25 May 2011 20:39:15 -0400 Subject: NGINX 1.0.3 compile error: undefined reference to `ngx_libc_crypt' Message-ID: <095bd58064177a9e78cb9129ade3170a.NginxMailingListEnglish@forum.nginx.org> Hey Guys, I've found a compile error for NGINX 1.0.3 that didn't exist for any of the previous versions (same configuration, etc.) Here's the "./configure" arguments I used: ./configure --sbin-path=/usr/local/sbin --with-http_ssl_module --with-ipv6 --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --without-http_autoindex_module --without-http_ssi_module --without-http_auth_basic_module --without-http_browser_module --without-http_empty_gif_module --without-http_geo_module --without-http_limit_req_module --without-http_limit_zone_module --without-http_map_module --without-http_memcached_module --without-http_proxy_module --without-http_referer_module --without-http_scgi_module --without-http_split_clients_module --without-http_upstream_ip_hash_module --without-http_userid_module --without-http_uwsgi_module --with-cc-opt=-O2 Then I ran "make" After a little while, this is the ouput: gcc -o objs/nginx \ objs/src/core/nginx.o \ [.....] objs/ngx_modules.o \ -lpcre -lssl -lcrypto -ldl -lz objs/src/core/ngx_crypt.o: In function `ngx_crypt': /home/wyatt/sources/nginx-1.0.3/src/core/ngx_crypt.c:48: undefined reference to `ngx_libc_crypt' collect2: ld returned 1 exit status make[1]: *** [objs/nginx] Error 1 make[1]: Leaving directory `/home/wyatt/sources/nginx-1.0.3' make: *** [build] Error 2 Am I doing something wrong, or is the problem somewhere in the ./configure or make scripts? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200948,200948#msg-200948 From kworthington at gmail.com Thu May 26 05:17:32 2011 From: kworthington at gmail.com (Kevin Worthington) Date: Wed, 25 May 2011 21:17:32 -0400 Subject: Nginx-1.0.3 for Windows 32-bit and 64-bit now available Message-ID: For those interested, Cygwin based versions of Nginx 1.0.3 for Windows (both 32-bit and 64-bit) builds are available here: http://www.kevinworthington.com/nginx-for-windows/ Blog post/announcement: http://www.kevinworthington.com/nginx-1-0-3-for-windows/ (comments and feedback welcome) Cygwin is NOT required on your system to run this version; all needed files are included. Please note that I have been providing Cygwin based builds since before official Windows builds were made available. It's mostly to support folks already using the builds. Thank you, Kevin -- Kevin Worthington http://www.kevinworthington.com/ From wendal1985 at gmail.com Thu May 26 06:09:27 2011 From: wendal1985 at gmail.com (Wendal Chen) Date: Thu, 26 May 2011 10:09:27 +0800 Subject: nginx-1.0.3 In-Reply-To: <20110525152453.GY83054@sysoev.ru> References: <20110525152453.GY83054@sysoev.ru> Message-ID: It has a bug! Build with : ./configure --without-http_auth_basic_module && make objs/src/core/ngx_crypt.o: In function `ngx_crypt': ngx_crypt.c:(.text+0x7b): undefined reference to `ngx_libc_crypt' collect2: ld returned 1 exit status make[1]: *** [objs/nginx] Error 1 make[1]: Leaving directory `/root/nginx-1.0.3' make: *** [build] Error 2 But ok when: ./configure && make 2011/5/25 Igor Sysoev > Changes with nginx 1.0.3 25 May > 2011 > > *) Feature: the "auth_basic_user_file" directive supports "$apr1", > "{PLAIN}", and "{SSHA}" password encryption methods. > Thanks to Maxim Dounin. > > *) Feature: the "geoip_org" directive and $geoip_org variable. > Thanks to Alexander Uskov, Arnaud Granal, and Denis F. Latypoff. > > *) Feature: ngx_http_geo_module and ngx_http_geoip_module support IPv4 > addresses mapped to IPv6 addresses. > > *) Bugfix: a segmentation fault occurred in a worker process during > testing IPv4 address mapped to IPv6 address, if access or deny rules > were defined only for IPv6; the bug had appeared in 0.8.22. > > *) Bugfix: a cached reponse may be broken if proxy/fastcgi/scgi/ > uwsgi_cache_bypass and proxy/fastcgi/scgi/uwsgi_no_cache directive > values were different; the bug had appeared in 0.8.46. > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -- Wendal Chen -------------- next part -------------- An HTML attachment was scrubbed... URL: From wendal1985 at gmail.com Thu May 26 06:13:36 2011 From: wendal1985 at gmail.com (Wendal Chen) Date: Thu, 26 May 2011 10:13:36 +0800 Subject: NGINX 1.0.3 compile error: undefined reference to `ngx_libc_crypt' In-Reply-To: <095bd58064177a9e78cb9129ade3170a.NginxMailingListEnglish@forum.nginx.org> References: <095bd58064177a9e78cb9129ade3170a.NginxMailingListEnglish@forum.nginx.org> Message-ID: remove : --without-http_auth_basic_module It will be ok. I think it is a Bug!! 2011/5/26 wyatt > Hey Guys, > > I've found a compile error for NGINX 1.0.3 that didn't exist for any of > the previous versions (same configuration, etc.) Here's the > "./configure" arguments I used: > > > ./configure --sbin-path=/usr/local/sbin --with-http_ssl_module > --with-ipv6 --without-mail_pop3_module --without-mail_imap_module > --without-mail_smtp_module --without-http_autoindex_module > --without-http_ssi_module --without-http_auth_basic_module > --without-http_browser_module --without-http_empty_gif_module > --without-http_geo_module --without-http_limit_req_module > --without-http_limit_zone_module --without-http_map_module > --without-http_memcached_module --without-http_proxy_module > --without-http_referer_module --without-http_scgi_module > --without-http_split_clients_module > --without-http_upstream_ip_hash_module --without-http_userid_module > --without-http_uwsgi_module --with-cc-opt=-O2 > > > Then I ran "make" > > After a little while, this is the ouput: > > > > gcc -o objs/nginx \ > objs/src/core/nginx.o \ > [.....] > objs/ngx_modules.o \ > -lpcre -lssl -lcrypto -ldl -lz > objs/src/core/ngx_crypt.o: In function `ngx_crypt': > /home/wyatt/sources/nginx-1.0.3/src/core/ngx_crypt.c:48: undefined > reference to `ngx_libc_crypt' > collect2: ld returned 1 exit status > make[1]: *** [objs/nginx] Error 1 > make[1]: Leaving directory `/home/wyatt/sources/nginx-1.0.3' > make: *** [build] Error 2 > > > > > Am I doing something wrong, or is the problem somewhere in the > ./configure or make scripts? > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,200948,200948#msg-200948 > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -- Wendal Chen -------------- next part -------------- An HTML attachment was scrubbed... URL: From wendal1985 at gmail.com Thu May 26 06:47:48 2011 From: wendal1985 at gmail.com (Wendal Chen) Date: Thu, 26 May 2011 10:47:48 +0800 Subject: nginx-1.0.3 In-Reply-To: References: <20110525152453.GY83054@sysoev.ru> Message-ID: I think there is the point: in ngx_crypt.c ngx_int_t ngx_crypt(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted) { if (ngx_strncmp(salt, "$apr1$", sizeof("$apr1$") - 1) == 0) { return ngx_crypt_apr1(pool, key, salt, encrypted); } else if (ngx_strncmp(salt, "{PLAIN}", sizeof("{PLAIN}") - 1) == 0) { return ngx_crypt_plain(pool, key, salt, encrypted); #if (NGX_HAVE_SHA1) } else if (ngx_strncmp(salt, "{SSHA}", sizeof("{SSHA}") - 1) == 0) { return ngx_crypt_ssha(pool, key, salt, encrypted); #endif } /* fallback to libc crypt() */ return ngx_libc_crypt(pool, key, salt, encrypted); } and there is no libc crypt in my system. So , I think is a bug . 2011/5/26 Wendal Chen > It has a bug! > > Build with : > ./configure --without-http_auth_basic_module && make > > objs/src/core/ngx_crypt.o: In function `ngx_crypt': > ngx_crypt.c:(.text+0x7b): undefined reference to `ngx_libc_crypt' > collect2: ld returned 1 exit status > make[1]: *** [objs/nginx] Error 1 > make[1]: Leaving directory `/root/nginx-1.0.3' > make: *** [build] Error 2 > > > But ok when: > ./configure && make > > > 2011/5/25 Igor Sysoev > >> Changes with nginx 1.0.3 25 May >> 2011 >> >> *) Feature: the "auth_basic_user_file" directive supports "$apr1", >> "{PLAIN}", and "{SSHA}" password encryption methods. >> Thanks to Maxim Dounin. >> >> *) Feature: the "geoip_org" directive and $geoip_org variable. >> Thanks to Alexander Uskov, Arnaud Granal, and Denis F. Latypoff. >> >> *) Feature: ngx_http_geo_module and ngx_http_geoip_module support IPv4 >> addresses mapped to IPv6 addresses. >> >> *) Bugfix: a segmentation fault occurred in a worker process during >> testing IPv4 address mapped to IPv6 address, if access or deny rules >> were defined only for IPv6; the bug had appeared in 0.8.22. >> >> *) Bugfix: a cached reponse may be broken if proxy/fastcgi/scgi/ >> uwsgi_cache_bypass and proxy/fastcgi/scgi/uwsgi_no_cache directive >> values were different; the bug had appeared in 0.8.46. >> >> >> -- >> Igor Sysoev >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://nginx.org/mailman/listinfo/nginx >> > > > > -- > Wendal Chen > > > -- Wendal Chen -------------- next part -------------- An HTML attachment was scrubbed... URL: From josh at joshparker.us Thu May 26 07:03:52 2011 From: josh at joshparker.us (=?utf-8?Q?Parker=2C_Joshua?=) Date: Wed, 25 May 2011 23:03:52 -0400 Subject: Error with http_perl_module Message-ID: <7104EC025B8F4C558C84166030307E0C@joshparker.us> I am trying to upgrade to 1.0.2, but I am getting an install error. Any help is greatly appreciated. make[2]: Leaving directory `/usr/local/src/nginx-1.0.2/objs/src/http/modules/perl' rm -rf objs/install_perl 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/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/ngx_http_postpone_filter_module.o \ objs/src/http/modules/ngx_http_ssi_filter_module.o \ objs/src/http/modules/ngx_http_charset_filter_module.o \ objs/src/http/modules/ngx_http_userid_filter_module.o \ objs/src/http/modules/ngx_http_autoindex_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_zone_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_rewrite_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/perl/ngx_http_perl_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_flv_module.o \ objs/src/http/modules/ngx_http_upstream_ip_hash_module.o \ objs/src/http/modules/ngx_http_stub_status_module.o \ objs/src/mail/ngx_mail.o \ objs/src/mail/ngx_mail_core_module.o \ objs/src/mail/ngx_mail_handler.o \ objs/src/mail/ngx_mail_parse.o \ objs/src/mail/ngx_mail_ssl_module.o \ objs/src/mail/ngx_mail_pop3_module.o \ objs/src/mail/ngx_mail_pop3_handler.o \ objs/src/mail/ngx_mail_imap_module.o \ objs/src/mail/ngx_mail_imap_handler.o \ objs/src/mail/ngx_mail_smtp_module.o \ objs/src/mail/ngx_mail_smtp_handler.o \ objs/src/mail/ngx_mail_auth_http_module.o \ objs/src/mail/ngx_mail_proxy_module.o \ objs/ngx_modules.o \ -lcrypt -lpcre -lssl -lcrypto -ldl -lz \ -Wl,-E -fstack-protector -L/usr/local/lib -L/usr/lib/perl/5.10/CORE -ldl -lm -lpthread -lc -lcrypt objs/src/http/modules/perl/ngx_http_perl_module.o: In function `ngx_http_perl_init_interpreter': /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:516: undefined reference to `Perl_sys_init' objs/src/http/modules/perl/ngx_http_perl_module.o: In function `ngx_http_perl_create_interpreter': /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:560: undefined reference to `perl_alloc' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:569: undefined reference to `PL_thr_key' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:569: undefined reference to `Perl_croak_nocontext' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:571: undefined reference to `perl_construct' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:598: undefined reference to `perl_parse' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:605: undefined reference to `Perl_get_sv' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:606: undefined reference to `Perl_sv_2pv_flags' objs/src/http/modules/perl/ngx_http_perl_module.o: In function `ngx_http_perl_run_requires': /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:648: undefined reference to `Perl_require_pv' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:650: undefined reference to `Perl_sv_2bool' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:652: undefined reference to `Perl_sv_2pv_flags' objs/src/http/modules/perl/ngx_http_perl_module.o: In function `ngx_http_perl_create_interpreter': /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:625: undefined reference to `perl_destruct' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:627: undefined reference to `perl_free' objs/src/http/modules/perl/ngx_http_perl_module.o: In function `ngx_http_perl_xs_init': /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:162: undefined reference to `boot_DynaLoader' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:162: undefined reference to `Perl_newXS' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:164: undefined reference to `Perl_gv_stashpv' objs/src/http/modules/perl/ngx_http_perl_module.o: In function `ngx_http_perl_cleanup_perl': /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:828: undefined reference to `PL_thr_key' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:828: undefined reference to `Perl_croak_nocontext' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:830: undefined reference to `perl_destruct' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:832: undefined reference to `perl_free' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:837: undefined reference to `Perl_sys_term' objs/src/http/modules/perl/ngx_http_perl_module.o: In function `ngx_http_perl_eval_anon_sub': /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:778: undefined reference to `Perl_eval_pv' objs/src/http/modules/perl/ngx_http_perl_module.o: In function `ngx_http_perl_set': /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:1007: undefined reference to `PL_thr_key' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:1007: undefined reference to `Perl_croak_nocontext' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:1018: undefined reference to `Perl_newSVpvn' objs/src/http/modules/perl/ngx_http_perl_module.o: In function `ngx_http_perl': /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:936: undefined reference to `PL_thr_key' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:936: undefined reference to `Perl_croak_nocontext' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:947: undefined reference to `Perl_newSVpvn' objs/src/http/modules/perl/ngx_http_perl_module.o: In function `ngx_http_perl_call_handler': /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:683: undefined reference to `Perl_push_scope' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:684: undefined reference to `Perl_save_int' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:686: undefined reference to `Perl_markstack_grow' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:688: undefined reference to `Perl_newSViv' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:688: undefined reference to `Perl_newRV_noinc' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:688: undefined reference to `Perl_sv_bless' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:688: undefined reference to `Perl_sv_2mortal' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:689: undefined reference to `Perl_stack_grow' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:692: undefined reference to `Perl_stack_grow' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:695: undefined reference to `Perl_sv_2mortal' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:703: undefined reference to `Perl_call_sv' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:709: undefined reference to `Perl_sv_2iv_flags' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:715: undefined reference to `Perl_sv_2pv_flags' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:729: undefined reference to `Perl_free_tmps' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:730: undefined reference to `Perl_pop_scope' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:734: undefined reference to `Perl_sv_2bool' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:736: undefined reference to `Perl_sv_2pv_flags' objs/src/http/modules/perl/ngx_http_perl_module.o: In function `ngx_http_perl_variable': /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:323: undefined reference to `PL_thr_key' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:323: undefined reference to `Perl_croak_nocontext' objs/src/http/modules/perl/ngx_http_perl_module.o: In function `ngx_http_perl_ssi': /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:388: undefined reference to `PL_thr_key' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:388: undefined reference to `Perl_croak_nocontext' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:408: undefined reference to `Perl_newSVpvn' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:419: undefined reference to `Perl_sv_free2' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:419: undefined reference to `Perl_sv_free' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:426: undefined reference to `Perl_newSVpvn' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:436: undefined reference to `Perl_sv_free2' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:436: undefined reference to `Perl_sv_free' objs/src/http/modules/perl/ngx_http_perl_module.o: In function `ngx_http_perl_init_worker': /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:1039: undefined reference to `PL_thr_key' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:1039: undefined reference to `Perl_croak_nocontext' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:1043: undefined reference to `Perl_gv_fetchpv' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:1043: undefined reference to `Perl_sv_setiv' objs/src/http/modules/perl/ngx_http_perl_module.o: In function `ngx_http_perl_handle_request': /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:208: undefined reference to `PL_thr_key' /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:208: undefined reference to `Perl_croak_nocontext' collect2: ld returned 1 exit status make[1]: *** [objs/nginx] Error 1 make[1]: Leaving directory `/usr/local/src/nginx-1.0.2' make: *** [install] Error 2 -- Parker, Joshua Sent with Sparrow (http://www.sparrowmailapp.com/?sig) -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Thu May 26 07:50:47 2011 From: nginx-forum at nginx.us (wyatt) Date: Wed, 25 May 2011 23:50:47 -0400 Subject: NGINX 1.0.3 compile error: undefined reference to `ngx_libc_crypt' In-Reply-To: References: Message-ID: <96abe5c394040f7411fe32d5376c044f.NginxMailingListEnglish@forum.nginx.org> Thanks, that worked. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200948,201006#msg-201006 From nginx-forum at nginx.us Thu May 26 08:13:51 2011 From: nginx-forum at nginx.us (agung) Date: Thu, 26 May 2011 00:13:51 -0400 Subject: Rewrite rule for nginx from Apache In-Reply-To: References: Message-ID: <0425005b61c87f8219125423c2e06c4c.NginxMailingListEnglish@forum.nginx.org> I still do not understand the previous explanation Can you help me to convert my htaccess to nginx... RewriteEngine on RewriteRule ^$ index.php [L] RewriteCond $1 !^(index\.php|info\.php|dotpro|poploud|users|upload_pic|static|oauth|sharefb|dotproject|error|facebook|blog|system/application/views/(apps-images|css-libraries|js-libraries|swf-library|video-library)|AuthSub\.php|robots\.txt|favicon\.ico|insecure\.php) RewriteRule ^(.*)$ index.php/$1 [L] thank's Posted at Nginx Forum: http://forum.nginx.org/read.php?2,23868,201013#msg-201013 From igor at sysoev.ru Thu May 26 09:31:13 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 26 May 2011 09:31:13 +0400 Subject: NGINX 1.0.3 compile error: undefined reference to `ngx_libc_crypt' In-Reply-To: <095bd58064177a9e78cb9129ade3170a.NginxMailingListEnglish@forum.nginx.org> References: <095bd58064177a9e78cb9129ade3170a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110526053113.GC86377@sysoev.ru> On Wed, May 25, 2011 at 08:39:15PM -0400, wyatt wrote: > Hey Guys, > > I've found a compile error for NGINX 1.0.3 that didn't exist for any of > the previous versions (same configuration, etc.) Here's the > "./configure" arguments I used: > > > ./configure --sbin-path=/usr/local/sbin --with-http_ssl_module > --with-ipv6 --without-mail_pop3_module --without-mail_imap_module > --without-mail_smtp_module --without-http_autoindex_module > --without-http_ssi_module --without-http_auth_basic_module > --without-http_browser_module --without-http_empty_gif_module > --without-http_geo_module --without-http_limit_req_module > --without-http_limit_zone_module --without-http_map_module > --without-http_memcached_module --without-http_proxy_module > --without-http_referer_module --without-http_scgi_module > --without-http_split_clients_module > --without-http_upstream_ip_hash_module --without-http_userid_module > --without-http_uwsgi_module --with-cc-opt=-O2 > > > Then I ran "make" > > After a little while, this is the ouput: > > > > gcc -o objs/nginx \ > objs/src/core/nginx.o \ > [.....] > objs/ngx_modules.o \ > -lpcre -lssl -lcrypto -ldl -lz > objs/src/core/ngx_crypt.o: In function `ngx_crypt': > /home/wyatt/sources/nginx-1.0.3/src/core/ngx_crypt.c:48: undefined > reference to `ngx_libc_crypt' > collect2: ld returned 1 exit status > make[1]: *** [objs/nginx] Error 1 > make[1]: Leaving directory `/home/wyatt/sources/nginx-1.0.3' > make: *** [build] Error 2 > > > > > Am I doing something wrong, or is the problem somewhere in the > ./configure or make scripts? The attached patch fixes the issue. -- Igor Sysoev -------------- next part -------------- Index: src/core/ngx_crypt.c =================================================================== --- src/core/ngx_crypt.c (revision 3925) +++ src/core/ngx_crypt.c (working copy) @@ -12,6 +12,8 @@ #endif +#if (NGX_CRYPT) + static ngx_int_t ngx_crypt_apr1(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted); static ngx_int_t ngx_crypt_plain(ngx_pool_t *pool, u_char *key, u_char *salt, @@ -232,3 +234,5 @@ } #endif /* NGX_HAVE_SHA1 */ + +#endif /* NGX_CRYPT */ From igor at sysoev.ru Thu May 26 11:05:03 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 26 May 2011 11:05:03 +0400 Subject: Rewrite rule for nginx from Apache In-Reply-To: References: <20110525113708.GJ83054@sysoev.ru> Message-ID: <20110526070503.GG86377@sysoev.ru> On Wed, May 25, 2011 at 02:30:28PM -0400, the_traveller wrote: > I know i'm alittle bit annoying > > but can you show me how i must write the rule > the path of the script jokes.php is in the public_html dir > and it should talks the args like that > jokes.php?j=$1 Where does this public_html directory reside ? /usr/local/www, /home/user/, or anything else ? -- Igor Sysoev From igor at sysoev.ru Thu May 26 11:40:48 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 26 May 2011 11:40:48 +0400 Subject: Error with http_perl_module In-Reply-To: <7104EC025B8F4C558C84166030307E0C@joshparker.us> References: <7104EC025B8F4C558C84166030307E0C@joshparker.us> Message-ID: <20110526074048.GI86377@sysoev.ru> On Wed, May 25, 2011 at 11:03:52PM -0400, Parker, Joshua wrote: > I am trying to upgrade to 1.0.2, but I am getting an install error. Any help is greatly appreciated. > -lcrypt -lpcre -lssl -lcrypto -ldl -lz \ > -Wl,-E -fstack-protector -L/usr/local/lib -L/usr/lib/perl/5.10/CORE -ldl -lm -lpthread -lc -lcrypt > objs/src/http/modules/perl/ngx_http_perl_module.o: In function `ngx_http_perl_init_interpreter': > /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:516: undefined reference to `Perl_sys_init' What does "perl -MExtUtils::Embed -e ldopts" show ? -- Igor Sysoev From mdounin at mdounin.ru Thu May 26 11:47:29 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 26 May 2011 11:47:29 +0400 Subject: nginx-1.0.3 In-Reply-To: References: <20110525152453.GY83054@sysoev.ru> Message-ID: <20110526074729.GC42265@mdounin.ru> Hello! On Thu, May 26, 2011 at 10:09:27AM +0800, Wendal Chen wrote: > It has a bug! > > Build with : > ./configure --without-http_auth_basic_module && make > > objs/src/core/ngx_crypt.o: In function `ngx_crypt': > ngx_crypt.c:(.text+0x7b): undefined reference to `ngx_libc_crypt' > collect2: ld returned 1 exit status > make[1]: *** [objs/nginx] Error 1 > make[1]: Leaving directory `/root/nginx-1.0.3' > make: *** [build] Error 2 > > > But ok when: > ./configure && make Thank you for your report. The following patch unbreaks build without auth basic module: diff --git a/src/core/ngx_crypt.c b/src/core/ngx_crypt.c --- a/src/core/ngx_crypt.c +++ b/src/core/ngx_crypt.c @@ -11,6 +11,7 @@ #include #endif +#if (NGX_CRYPT) static ngx_int_t ngx_crypt_apr1(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted); @@ -232,3 +233,5 @@ ngx_crypt_ssha(ngx_pool_t *pool, u_char } #endif /* NGX_HAVE_SHA1 */ + +#endif /* NGX_CRYPT */ Maxim Dounin From mdounin at mdounin.ru Thu May 26 12:03:26 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 26 May 2011 12:03:26 +0400 Subject: How to make a redirect via programming? In-Reply-To: References: Message-ID: <20110526080326.GD42265@mdounin.ru> Hello! On Wed, May 25, 2011 at 06:41:46PM -0400, speedfirst wrote: > Hey, I'm making a custom module and need to send back the redirect > response to the client. It should behave like the "sendRedirect" in java > servlet programming. So which function is that API? > > Thanks. r->headers_out.location = ngx_palloc(r->pool, sizeof(ngx_table_elt_t)); if (r->headers_out.location == NULL) { return NGX_HTTP_INTERNAL_SERVER_ERROR; } r->headers_out.location->value.len = sizeof("http://example.com/") - 1; r->headers_out.location->value.data = "http://example.com/"; return NGX_HTTP_MOVED_PERMANENTLY; Maxim Dounin From Richard.Kearsley at m247.com Thu May 26 12:06:37 2011 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Thu, 26 May 2011 08:06:37 +0000 Subject: core dumps Message-ID: Hi I'm trying to get a core dump out of nginx but it isn't working... I have done the following: Made directory with permissions: drwxr-xr-x 2 root root 4.0K 2011-05-26 00:32 nginx-core changed config: worker_rlimit_core 512M; working_directory /home/dcstaff/nginx-core/; but no dump is made when it crashes: 2011/05/26 06:46:50 [alert] 20526#0: worker process 20547 exited on signal 11 Is there any other trick to it? From Richard.Kearsley at m247.com Thu May 26 12:11:09 2011 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Thu, 26 May 2011 08:11:09 +0000 Subject: core dumps In-Reply-To: References: Message-ID: I should say this is on linux - ubuntu 10.10 -----Original Message----- From: Richard Kearsley [mailto:Richard.Kearsley at m247.com] Sent: 26 May 2011 09:07 To: 'nginx at nginx.org' Subject: core dumps Hi I'm trying to get a core dump out of nginx but it isn't working... I have done the following: Made directory with permissions: drwxr-xr-x 2 root root 4.0K 2011-05-26 00:32 nginx-core changed config: worker_rlimit_core 512M; working_directory /home/dcstaff/nginx-core/; but no dump is made when it crashes: 2011/05/26 06:46:50 [alert] 20526#0: worker process 20547 exited on signal 11 Is there any other trick to it? _______________________________________________ nginx mailing list nginx at nginx.org http://nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdounin at mdounin.ru Thu May 26 12:26:08 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 26 May 2011 12:26:08 +0400 Subject: core dumps In-Reply-To: References: Message-ID: <20110526082608.GE42265@mdounin.ru> Hello! On Thu, May 26, 2011 at 08:06:37AM +0000, Richard Kearsley wrote: > Hi > I'm trying to get a core dump out of nginx but it isn't working... > > I have done the following: > > Made directory with permissions: > drwxr-xr-x 2 root root 4.0K 2011-05-26 00:32 nginx-core > > changed config: > worker_rlimit_core 512M; > working_directory /home/dcstaff/nginx-core/; > > but no dump is made when it crashes: > 2011/05/26 06:46:50 [alert] 20526#0: worker process 20547 exited on signal 11 > > Is there any other trick to it? Worker processes are usually run under non-root, so it's unlikely that write permissions for root will be enough. Maxim Dounin From nginx-forum at nginx.us Thu May 26 12:34:51 2011 From: nginx-forum at nginx.us (chris.percol) Date: Thu, 26 May 2011 04:34:51 -0400 Subject: redirect subdomain to internal location In-Reply-To: <8762oyli45.wl%appa@perusio.net> References: <8762oyli45.wl%appa@perusio.net> Message-ID: <8539335ce68bd599dd41fd22d7ebae74.NginxMailingListEnglish@forum.nginx.org> Ant?nio P. P. Almeida Wrote: ------------------------------------------------------- > On 25 Mai 2011 19h14 WEST, nginx-forum at nginx.us > wrote: > > > >> location ~ /(?[^/]*)/ { > > > > Appa, > > > > Thanks again! > > > > My issue is that I don't know the value of > clientkey, it could be > > several hundred possibilities. > > > > Is there a way to extract the unknown clientkey > from > > /clientkey/some/more.htm? > > > > Many thanks, > > That's completely generic. It's a named group that > captures any char > excepting '/'. > > This implicitly creates a variable $clientkey that > you can use. > > Try it. > --- appa > Appa, Thanks, no joy, but get it now. Think problem may be down to my perl version, will try with ?P. Chris > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200694,201071#msg-201071 From Richard.Kearsley at m247.com Thu May 26 13:02:26 2011 From: Richard.Kearsley at m247.com (Richard Kearsley) Date: Thu, 26 May 2011 09:02:26 +0000 Subject: core dumps In-Reply-To: <20110526082608.GE42265@mdounin.ru> References: <20110526082608.GE42265@mdounin.ru> Message-ID: Sorry, I chose a bad example I have 3 machines where it's not dumping The other 2 had the correct permissions already Should it core dump for signal 11 of a worker? > Worker processes are usually run under non-root, so it's unlikely > that write permissions for root will be enough. _______________________________________________ nginx mailing list nginx at nginx.org http://nginx.org/mailman/listinfo/nginx From nginx-forum at nginx.us Thu May 26 14:11:10 2011 From: nginx-forum at nginx.us (slafs) Date: Thu, 26 May 2011 06:11:10 -0400 Subject: IP as a server name Message-ID: Hi there! I have a question about nginx configuration file. How can I configure a server if I want my site to be available under a domain name and IP address. I would like to have something like: http(s)://myhost.mydomain/foo/ and http(s)://XXX.XXX.XXX.XXX/foo/ to be available simultaneously. I noticed that it basically works but problem occurs on redirections from my webapp (Nginx is a reverse proxy for it). It seems that on redirects nginx is obtaining a server_name from OS configuration. Can You please suggest some configuration? I am using nginx 0.6.39 but will try to upgrade if it is necessary. Regards S?awek Posted at Nginx Forum: http://forum.nginx.org/read.php?2,201092,201092#msg-201092 From josh at joshparker.us Thu May 26 14:22:39 2011 From: josh at joshparker.us (=?utf-8?Q?Parker=2C_Joshua?=) Date: Thu, 26 May 2011 06:22:39 -0400 Subject: Error with http_perl_module In-Reply-To: <20110526074048.GI86377@sysoev.ru> References: <7104EC025B8F4C558C84166030307E0C@joshparker.us> <20110526074048.GI86377@sysoev.ru> Message-ID: <93C96B6191494951985C5928158923EA@joshparker.us> Please see below. Note (probably harmless): No library found for -lperl -Wl,-E -fstack-protector -L/usr/local/lib -L/usr/lib/perl/5.10/CORE -ldl -lm -lpthread -lc -lcrypt -- Parker, Joshua Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Thursday, May 26, 2011 at 3:40 AM, Igor Sysoev wrote: > On Wed, May 25, 2011 at 11:03:52PM -0400, Parker, Joshua wrote: > > I am trying to upgrade to 1.0.2, but I am getting an install error. Any help is greatly appreciated. > > > -lcrypt -lpcre -lssl -lcrypto -ldl -lz \ > > -Wl,-E -fstack-protector -L/usr/local/lib -L/usr/lib/perl/5.10/CORE -ldl -lm -lpthread -lc -lcrypt > > objs/src/http/modules/perl/ngx_http_perl_module.o: In function `ngx_http_perl_init_interpreter': > > /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:516: undefined reference to `Perl_sys_init' > > What does "perl -MExtUtils::Embed -e ldopts" show ? > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org (mailto:nginx at nginx.org) > http://nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Thu May 26 14:30:13 2011 From: nginx-forum at nginx.us (slafs) Date: Thu, 26 May 2011 06:30:13 -0400 Subject: IP as a server name In-Reply-To: References: Message-ID: Ok found it. Sorry. server_name_in_redirect off; did the trick. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,201092,201100#msg-201100 From igor at sysoev.ru Thu May 26 14:33:08 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 26 May 2011 14:33:08 +0400 Subject: Error with http_perl_module In-Reply-To: <93C96B6191494951985C5928158923EA@joshparker.us> References: <7104EC025B8F4C558C84166030307E0C@joshparker.us> <20110526074048.GI86377@sysoev.ru> <93C96B6191494951985C5928158923EA@joshparker.us> Message-ID: <20110526103308.GA12142@sysoev.ru> On Thu, May 26, 2011 at 06:22:39AM -0400, Parker, Joshua wrote: > Please see below. > > Note (probably harmless): No library found for -lperl > -Wl,-E -fstack-protector -L/usr/local/lib -L/usr/lib/perl/5.10/CORE -ldl -lm -lpthread -lc -lcrypt LOL, "probably harmless". libperl is the very library required for linking. It's seems you have broken perl installation. > -- > Parker, Joshua > Sent with Sparrow (http://www.sparrowmailapp.com/?sig) > > On Thursday, May 26, 2011 at 3:40 AM, Igor Sysoev wrote: > > > On Wed, May 25, 2011 at 11:03:52PM -0400, Parker, Joshua wrote: > > > I am trying to upgrade to 1.0.2, but I am getting an install error. Any help is greatly appreciated. > > > > > -lcrypt -lpcre -lssl -lcrypto -ldl -lz \ > > > -Wl,-E -fstack-protector -L/usr/local/lib -L/usr/lib/perl/5.10/CORE -ldl -lm -lpthread -lc -lcrypt > > > objs/src/http/modules/perl/ngx_http_perl_module.o: In function `ngx_http_perl_init_interpreter': > > > /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:516: undefined reference to `Perl_sys_init' > > > > What does "perl -MExtUtils::Embed -e ldopts" show ? -- Igor Sysoev From josh at joshparker.us Thu May 26 14:36:08 2011 From: josh at joshparker.us (=?utf-8?Q?Parker=2C_Joshua?=) Date: Thu, 26 May 2011 06:36:08 -0400 Subject: Error with http_perl_module In-Reply-To: <20110526103308.GA12142@sysoev.ru> References: <7104EC025B8F4C558C84166030307E0C@joshparker.us> <20110526074048.GI86377@sysoev.ru> <93C96B6191494951985C5928158923EA@joshparker.us> <20110526103308.GA12142@sysoev.ru> Message-ID: <044BD18713004A6EA2A40D3106298F98@joshparker.us> I don't remember installing perl, so the message may be a misdirection. How would I install perl on Ubuntu Lucid? I am not sure what perl package I should be looking for. -- Parker, Joshua Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Thursday, May 26, 2011 at 6:33 AM, Igor Sysoev wrote: > On Thu, May 26, 2011 at 06:22:39AM -0400, Parker, Joshua wrote: > > Please see below. > > > > Note (probably harmless): No library found for -lperl > > -Wl,-E -fstack-protector -L/usr/local/lib -L/usr/lib/perl/5.10/CORE -ldl -lm -lpthread -lc -lcrypt > > LOL, "probably harmless". libperl is the very library required for linking. > It's seems you have broken perl installation. > > > -- > > Parker, Joshua > > Sent with Sparrow (http://www.sparrowmailapp.com/?sig) > > > > On Thursday, May 26, 2011 at 3:40 AM, Igor Sysoev wrote: > > > > > On Wed, May 25, 2011 at 11:03:52PM -0400, Parker, Joshua wrote: > > > > I am trying to upgrade to 1.0.2, but I am getting an install error. Any help is greatly appreciated. > > > > > > > -lcrypt -lpcre -lssl -lcrypto -ldl -lz \ > > > > -Wl,-E -fstack-protector -L/usr/local/lib -L/usr/lib/perl/5.10/CORE -ldl -lm -lpthread -lc -lcrypt > > > > objs/src/http/modules/perl/ngx_http_perl_module.o: In function `ngx_http_perl_init_interpreter': > > > > /usr/local/src/nginx-1.0.2/src/http/modules/perl/ngx_http_perl_module.c:516: undefined reference to `Perl_sys_init' > > > > > > What does "perl -MExtUtils::Embed -e ldopts" show ? > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org (mailto:nginx at nginx.org) > http://nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor at sysoev.ru Thu May 26 14:37:22 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 26 May 2011 14:37:22 +0400 Subject: core dumps In-Reply-To: References: <20110526082608.GE42265@mdounin.ru> Message-ID: <20110526103722.GB12142@sysoev.ru> On Thu, May 26, 2011 at 09:02:26AM +0000, Richard Kearsley wrote: > Sorry, I chose a bad example > I have 3 machines where it's not dumping > The other 2 had the correct permissions already > Should it core dump for signal 11 of a worker? Probably you need to set also: echo 1 > /proc/sys/fs/suid_dumpable > > Worker processes are usually run under non-root, so it's unlikely > > that write permissions for root will be enough. -- Igor Sysoev From igor at sysoev.ru Thu May 26 14:39:47 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 26 May 2011 14:39:47 +0400 Subject: Error with http_perl_module In-Reply-To: <044BD18713004A6EA2A40D3106298F98@joshparker.us> References: <7104EC025B8F4C558C84166030307E0C@joshparker.us> <20110526074048.GI86377@sysoev.ru> <93C96B6191494951985C5928158923EA@joshparker.us> <20110526103308.GA12142@sysoev.ru> <044BD18713004A6EA2A40D3106298F98@joshparker.us> Message-ID: <20110526103947.GC12142@sysoev.ru> On Thu, May 26, 2011 at 06:36:08AM -0400, Parker, Joshua wrote: > I don't remember installing perl, so the message may be a misdirection. How would I install perl on Ubuntu Lucid? I am not sure what perl package I should be looking for. Last time I tried this on Debian, libper-dev package was required. -- Igor Sysoev From josh at joshparker.us Thu May 26 14:40:17 2011 From: josh at joshparker.us (=?utf-8?Q?Parker=2C_Joshua?=) Date: Thu, 26 May 2011 06:40:17 -0400 Subject: Error with http_perl_module In-Reply-To: <20110526103947.GC12142@sysoev.ru> References: <7104EC025B8F4C558C84166030307E0C@joshparker.us> <20110526074048.GI86377@sysoev.ru> <93C96B6191494951985C5928158923EA@joshparker.us> <20110526103308.GA12142@sysoev.ru> <044BD18713004A6EA2A40D3106298F98@joshparker.us> <20110526103947.GC12142@sysoev.ru> Message-ID: <19866AB3B49849D686422D9BAD0E2071@joshparker.us> Ok, thanks. -- Parker, Joshua Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Thursday, May 26, 2011 at 6:39 AM, Igor Sysoev wrote: > On Thu, May 26, 2011 at 06:36:08AM -0400, Parker, Joshua wrote: > > I don't remember installing perl, so the message may be a misdirection. How would I install perl on Ubuntu Lucid? I am not sure what perl package I should be looking for. > > Last time I tried this on Debian, libper-dev package was required. > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org (mailto:nginx at nginx.org) > http://nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Thu May 26 14:47:38 2011 From: nginx-forum at nginx.us (chris.percol) Date: Thu, 26 May 2011 06:47:38 -0400 Subject: redirect subdomain to internal location In-Reply-To: <98b315ad9cc32b0957db3ff6074d4799.NginxMailingListEnglish@forum.nginx.org> References: <98b315ad9cc32b0957db3ff6074d4799.NginxMailingListEnglish@forum.nginx.org> Message-ID: <752f7a108532c2eed1e980fdc1806b01.NginxMailingListEnglish@forum.nginx.org> Nearly there! Thanks to Appa I have got this far... location ~ /(?[^/]*)/ { What I didn't consider was that sometimes the result I am testing for may not have a proceeding '/'. How I update the rexex to allow for /mytest as well as /mytest? Many thanks, Chris Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200694,201110#msg-201110 From appa at perusio.net Thu May 26 15:04:09 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Thu, 26 May 2011 12:04:09 +0100 Subject: redirect subdomain to internal location In-Reply-To: <752f7a108532c2eed1e980fdc1806b01.NginxMailingListEnglish@forum.nginx.org> References: <98b315ad9cc32b0957db3ff6074d4799.NginxMailingListEnglish@forum.nginx.org> <752f7a108532c2eed1e980fdc1806b01.NginxMailingListEnglish@forum.nginx.org> Message-ID: <874o4hlo46.wl%appa@perusio.net> On 26 Mai 2011 11h47 WEST, nginx-forum at nginx.us wrote: > Nearly there! > > Thanks to Appa I have got this far... > > location ~ /(?[^/]*)/ { > > What I didn't consider was that sometimes the result I am testing > for may not have a proceeding '/'. location ~ ^/(?[^/]*) { (...) } All requests of the form domain.com/whatever are now matched. You're capturing only the 1st component of the URI 'whatever'. --- appa From nginx-forum at nginx.us Thu May 26 16:46:14 2011 From: nginx-forum at nginx.us (chris.percol) Date: Thu, 26 May 2011 08:46:14 -0400 Subject: redirect subdomain to internal location In-Reply-To: <874o4hlo46.wl%appa@perusio.net> References: <874o4hlo46.wl%appa@perusio.net> Message-ID: <23e4e44d2a87c6565eb231f9f0185a4b.NginxMailingListEnglish@forum.nginx.org> Appa, Thanks for your help and patience! Chris Posted at Nginx Forum: http://forum.nginx.org/read.php?2,200694,201148#msg-201148 From nginx-forum at nginx.us Thu May 26 17:46:47 2011 From: nginx-forum at nginx.us (the_traveller) Date: Thu, 26 May 2011 09:46:47 -0400 Subject: Rewrite rule for nginx from Apache In-Reply-To: References: Message-ID: <978224f0ac741f3163cc698c0baa9103.NginxMailingListEnglish@forum.nginx.org> the public_html dir is in /usr/local/www Posted at Nginx Forum: http://forum.nginx.org/read.php?2,23868,201159#msg-201159 From igor at sysoev.ru Thu May 26 17:51:42 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Thu, 26 May 2011 17:51:42 +0400 Subject: Rewrite rule for nginx from Apache In-Reply-To: <978224f0ac741f3163cc698c0baa9103.NginxMailingListEnglish@forum.nginx.org> References: <978224f0ac741f3163cc698c0baa9103.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110526135142.GA37526@sysoev.ru> On Thu, May 26, 2011 at 09:46:47AM -0400, the_traveller wrote: > the public_html dir is in > /usr/local/www location /Joke/ { fastcgi_pass backend; fastcgi_param SCRIPT_FILENAME /usr/local/www/public_html/jokes.php; fastcgi_param QUERY_STRING $args; inlcude fastcgi_params; } -- Igor Sysoev From lists at ruby-forum.com Thu May 26 19:59:38 2011 From: lists at ruby-forum.com (John Travolota) Date: Thu, 26 May 2011 17:59:38 +0200 Subject: kernel: nginx[18233]: segfault at 0000000000000008 rip 000000000043edf8 rsp 00007fff34a21fa0 err In-Reply-To: References: Message-ID: <4919c744e69acf0b9a463d19443be22f@ruby-forum.com> It's a bit different segfault now: segfault at 0000000000000008 rip 000000000043a5ab rsp 00007fff43146db0 error 4 Probably because i upgraded to version 1.3.I didn't do debugging,but i found out what exactly module causing segfault-it's geoip module.I noticed by reverting to ver seven first,and segfault occurred again,including when i changed conf to configure without SSI and SSL.Before this segfault error i didn't used geoip module.Perhaps is nginx overloaded due to a lot of request from redirected countries.Any idea how to fix it? -- Posted via http://www.ruby-forum.com/. From mdounin at mdounin.ru Thu May 26 20:09:42 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 26 May 2011 20:09:42 +0400 Subject: kernel: nginx[18233]: segfault at 0000000000000008 rip 000000000043edf8 rsp 00007fff34a21fa0 err In-Reply-To: <4919c744e69acf0b9a463d19443be22f@ruby-forum.com> References: <4919c744e69acf0b9a463d19443be22f@ruby-forum.com> Message-ID: <20110526160942.GF42265@mdounin.ru> Hello! On Thu, May 26, 2011 at 05:59:38PM +0200, John Travolota wrote: > It's a bit different segfault now: segfault at 0000000000000008 rip > 000000000043a5ab rsp 00007fff43146db0 error 4 > Probably because i upgraded to version 1.3.I didn't do debugging,but i > found out what exactly module causing segfault-it's geoip module.I > noticed by reverting to ver seven first,and segfault occurred > again,including when i changed conf to configure without SSI and > SSL.Before this segfault error i didn't used geoip module.Perhaps is > nginx overloaded due to a lot of request from redirected countries.Any > idea how to fix it? You may want to debug it further (see http://wiki.nginx.org/Debugging), but please note that MaxMind's GeoIP library (the one which geoip module uses) segfaults on incorrect/corrupted database[1]. Checking if your MaxMind's database isn't corrupted is a good idea. [1] And this is one of the reasons I recommend using geo module instead and always wonder if people use geoip. Maxim Dounin From nginx-forum at nginx.us Thu May 26 23:22:36 2011 From: nginx-forum at nginx.us (benseb) Date: Thu, 26 May 2011 15:22:36 -0400 Subject: Sanity check of my config - is it secure? In-Reply-To: <3ce420be0701a81ea969389d395b6a49.NginxMailingListEnglish@forum.nginx.org> References: <3ce420be0701a81ea969389d395b6a49.NginxMailingListEnglish@forum.nginx.org> Message-ID: <0df75b6b4e445800bb6bf833adb91008.NginxMailingListEnglish@forum.nginx.org> Can anyone help with the above request, regarding checking if a filename DOESNT match the whitelist above (block all other filetypes) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199902,201268#msg-201268 From appa at perusio.net Thu May 26 23:32:10 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Thu, 26 May 2011 20:32:10 +0100 Subject: Sanity check of my config - is it secure? In-Reply-To: <0df75b6b4e445800bb6bf833adb91008.NginxMailingListEnglish@forum.nginx.org> References: <3ce420be0701a81ea969389d395b6a49.NginxMailingListEnglish@forum.nginx.org> <0df75b6b4e445800bb6bf833adb91008.NginxMailingListEnglish@forum.nginx.org> Message-ID: <87pqn5jm11.wl%appa@perusio.net> On 26 Mai 2011 20h22 WEST, nginx-forum at nginx.us wrote: Your're letting the reverse logical style of mod_rewrite and .htaccess color your perception. In Nginx things operate in a forward logical way: 1. Define which extensions you want to allow, e.g.: location ~* \.(?:jpe?g|png|ico|gif|css|js|) { # serve the files } location ~* (which extensions are going to be blocked) { return 444; } Mind you that relying solely on the file extension is a rather weak way of filtering files. You can tamper the file magic number quite easily. > Can anyone help with the above request, regarding checking if a > filename DOESNT match the whitelist above (block all other > filetypes) --- appa From nginx-forum at nginx.us Thu May 26 23:36:51 2011 From: nginx-forum at nginx.us (benseb) Date: Thu, 26 May 2011 15:36:51 -0400 Subject: Sanity check of my config - is it secure? In-Reply-To: <87pqn5jm11.wl%appa@perusio.net> References: <87pqn5jm11.wl%appa@perusio.net> Message-ID: <984ac956e570b8e9b5e5b22ee356cd9b.NginxMailingListEnglish@forum.nginx.org> Thanks, in your opinion what's the best way to approach this? I basically want to ensure that our static.domain.com subdomain ONLY servers image/js/css files. Whilst I have set 'location' for only the folders which have images, etc in, I want to ensure that if someone put a script into one of those directories, it would not be executed. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199902,201276#msg-201276 From appa at perusio.net Thu May 26 23:46:50 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Thu, 26 May 2011 20:46:50 +0100 Subject: Sanity check of my config - is it secure? In-Reply-To: <984ac956e570b8e9b5e5b22ee356cd9b.NginxMailingListEnglish@forum.nginx.org> References: <87pqn5jm11.wl%appa@perusio.net> <984ac956e570b8e9b5e5b22ee356cd9b.NginxMailingListEnglish@forum.nginx.org> Message-ID: <87oc2pjlcl.wl%appa@perusio.net> On 26 Mai 2011 20h36 WEST, nginx-forum at nginx.us wrote: > Thanks, in your opinion what's the best way to approach this? I > basically want to ensure that our static.domain.com subdomain ONLY > servers image/js/css files. > > Whilst I have set 'location' for only the folders which have images, > etc in, I want to ensure that if someone put a script into one of > those directories, it would not be executed. If I understood correctly: there's no need to worry then. If there's no embedded interpreter (Perl/Lua) or a fastcgi backend configured on that vhost. There's no way that someone will be able to run a script from the web there. --- appa From nginx-forum at nginx.us Thu May 26 23:49:41 2011 From: nginx-forum at nginx.us (benseb) Date: Thu, 26 May 2011 15:49:41 -0400 Subject: Sanity check of my config - is it secure? In-Reply-To: <87oc2pjlcl.wl%appa@perusio.net> References: <87oc2pjlcl.wl%appa@perusio.net> Message-ID: <4eeedadeefe2d50b4c7c7b3e3f487255.NginxMailingListEnglish@forum.nginx.org> I presume in that case, if there was a script and no interpreter, it would just display the contents of the file - which again could be a security risk. So I need to perhaps limit the mime types that can be served, or the file extensions - which ever is most secure? I basically don't want a php script in that directory being served and the source code being visible Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199902,201282#msg-201282 From appa at perusio.net Thu May 26 23:59:31 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Thu, 26 May 2011 20:59:31 +0100 Subject: Sanity check of my config - is it secure? In-Reply-To: <4eeedadeefe2d50b4c7c7b3e3f487255.NginxMailingListEnglish@forum.nginx.org> References: <87oc2pjlcl.wl%appa@perusio.net> <4eeedadeefe2d50b4c7c7b3e3f487255.NginxMailingListEnglish@forum.nginx.org> Message-ID: <87mxi9jkrg.wl%appa@perusio.net> On 26 Mai 2011 20h49 WEST, nginx-forum at nginx.us wrote: > I presume in that case, if there was a script and no interpreter, it > would just display the contents of the file - which again could be a > security risk. > So I need to perhaps limit the mime types that can be served, or the > file extensions - which ever is most secure? Do both. That's my advice. Regarding the later, something along the lines of: location ^~ /static_files_dir/ { location ~* /static_files_dir/.+\.(?:jpe?g|png|gif|ico|css|js)$ { expires 30d; } location ~* /static_files_dir/.*\.php$ { return 444; # return an empty response for a php file } } --- appa From nunomagalhaes at eu.ipp.pt Fri May 27 00:04:31 2011 From: nunomagalhaes at eu.ipp.pt (=?UTF-8?Q?Nuno_Magalh=C3=A3es?=) Date: Thu, 26 May 2011 21:04:31 +0100 Subject: Sanity check of my config - is it secure? In-Reply-To: <87mxi9jkrg.wl%appa@perusio.net> References: <87oc2pjlcl.wl%appa@perusio.net> <4eeedadeefe2d50b4c7c7b3e3f487255.NginxMailingListEnglish@forum.nginx.org> <87mxi9jkrg.wl%appa@perusio.net> Message-ID: Hi On Thu, May 26, 2011 at 20:59, Ant?nio P. P. Almeida wrote: > return 444; # return an empty response for a php file AFAIK 444 just closes the connection, sending nothing. http://wiki.nginx.org/HttpRewriteModule#return Or does it actually send an empty response (without headers)? -- Mars 2 Stay! http://xkcd.com/801/ /etc From nginx-forum at nginx.us Fri May 27 00:10:23 2011 From: nginx-forum at nginx.us (benseb) Date: Thu, 26 May 2011 16:10:23 -0400 Subject: Sanity check of my config - is it secure? In-Reply-To: <4eeedadeefe2d50b4c7c7b3e3f487255.NginxMailingListEnglish@forum.nginx.org> References: <87oc2pjlcl.wl%appa@perusio.net> <4eeedadeefe2d50b4c7c7b3e3f487255.NginxMailingListEnglish@forum.nginx.org> Message-ID: <3538d29804bc922548e34af913cb5963.NginxMailingListEnglish@forum.nginx.org> Thanks people So there's no way to say "If the file ISNT a jpeg/gif/css/js" deny. The only way is to say 'if .php' deny, 'if .txt deny' etc? I'd prefer to whitelist the files i DO want to return and block everything else, incase I forget something to block? Ben Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199902,201289#msg-201289 From appa at perusio.net Fri May 27 00:18:31 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Thu, 26 May 2011 21:18:31 +0100 Subject: Sanity check of my config - is it secure? In-Reply-To: <3538d29804bc922548e34af913cb5963.NginxMailingListEnglish@forum.nginx.org> References: <87oc2pjlcl.wl%appa@perusio.net> <4eeedadeefe2d50b4c7c7b3e3f487255.NginxMailingListEnglish@forum.nginx.org> <3538d29804bc922548e34af913cb5963.NginxMailingListEnglish@forum.nginx.org> Message-ID: <87lixtjjvs.wl%appa@perusio.net> On 26 Mai 2011 21h10 WEST, nginx-forum at nginx.us wrote: > Thanks people > > So there's no way to say "If the file ISNT a jpeg/gif/css/js" > deny. The only way is to say 'if .php' deny, 'if .txt deny' etc? > > I'd prefer to whitelist the files i DO want to return and block > everything else, incase I forget something to block? > Try this: location ~* /static_files_dir/(?[^.]*)\.(?.*)$ { if ($extension !~ (?:jpe?g|png|gif|ico|css|js)) { return 444; } } It's rather ugly :( --- appa From appa at perusio.net Fri May 27 00:20:57 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Thu, 26 May 2011 21:20:57 +0100 Subject: Sanity check of my config - is it secure? In-Reply-To: <3538d29804bc922548e34af913cb5963.NginxMailingListEnglish@forum.nginx.org> References: <87oc2pjlcl.wl%appa@perusio.net> <4eeedadeefe2d50b4c7c7b3e3f487255.NginxMailingListEnglish@forum.nginx.org> <3538d29804bc922548e34af913cb5963.NginxMailingListEnglish@forum.nginx.org> Message-ID: <87k4ddjjrq.wl%appa@perusio.net> On 26 Mai 2011 21h10 WEST, nginx-forum at nginx.us wrote: > Thanks people > > So there's no way to say "If the file ISNT a jpeg/gif/css/js" > deny. The only way is to say 'if .php' deny, 'if .txt deny' etc? > > I'd prefer to whitelist the files i DO want to return and block > everything else, incase I forget something to block? > Try this: location ~* /static_files_dir/(?:[^.]*)\.(?.*)$ { if ($extension !~ (jpe?g|png|gif|ico|css|js)) { return 444; } } It's rather ugly :( --- appa PS: No need to use ?: in the if condition. From appa at perusio.net Fri May 27 00:23:33 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Thu, 26 May 2011 21:23:33 +0100 Subject: Sanity check of my config - is it secure? In-Reply-To: <3538d29804bc922548e34af913cb5963.NginxMailingListEnglish@forum.nginx.org> References: <87oc2pjlcl.wl%appa@perusio.net> <4eeedadeefe2d50b4c7c7b3e3f487255.NginxMailingListEnglish@forum.nginx.org> <3538d29804bc922548e34af913cb5963.NginxMailingListEnglish@forum.nginx.org> Message-ID: <87ipsxjjne.wl%appa@perusio.net> On 26 Mai 2011 21h10 WEST, nginx-forum at nginx.us wrote: > Thanks people > > So there's no way to say "If the file ISNT a jpeg/gif/css/js" > deny. The only way is to say 'if .php' deny, 'if .txt deny' etc? > > I'd prefer to whitelist the files i DO want to return and block > everything else, incase I forget something to block? > Try this: location ~* /static_files_dir/(?:[^.]*)\.(?.*)$ { if ($extension !~ (jpe?g|png|gif|ico|css|js)) { return 444; } } It's rather ugly :( --- appa PS: No need to use ?: in the if condition. PPS: Note that if the filenames have dots '.' in them the above regex will fail to capture the extension correctly. You're opening a can of worms config wise when going down this path. From nginx-forum at nginx.us Fri May 27 00:30:53 2011 From: nginx-forum at nginx.us (benseb) Date: Thu, 26 May 2011 16:30:53 -0400 Subject: Sanity check of my config - is it secure? In-Reply-To: <87k4ddjjrq.wl%appa@perusio.net> References: <87k4ddjjrq.wl%appa@perusio.net> Message-ID: <56b117011b76c1e7bf01d0db1635ba95.NginxMailingListEnglish@forum.nginx.org> Thanks for the advice Seems strange that this isn't an easy thing to do. After all, ALL security advise always recommends whitelisting what you want and denying everything else! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199902,201299#msg-201299 From appa at perusio.net Fri May 27 00:42:55 2011 From: appa at perusio.net (=?UTF-8?B?QW50w7NuaW8=?= P. P. Almeida) Date: Thu, 26 May 2011 21:42:55 +0100 Subject: Sanity check of my config - is it secure? In-Reply-To: <56b117011b76c1e7bf01d0db1635ba95.NginxMailingListEnglish@forum.nginx.org> References: <87k4ddjjrq.wl%appa@perusio.net> <56b117011b76c1e7bf01d0db1635ba95.NginxMailingListEnglish@forum.nginx.org> Message-ID: <87hb8hjir4.wl%appa@perusio.net> On 26 Mai 2011 21h30 WEST, nginx-forum at nginx.us wrote: > Thanks for the advice > > Seems strange that this isn't an easy thing to do. After all, ALL > security advise always recommends whitelisting what you want and > denying everything else! The config with two regex locations nested did that. But if you're asking for a *catch all* regex that blocks every other extension besides css, js, &c, then you're thinking in terms of the complement of the set of allowed extensions. It's easier to enunciate the negative than the positivem due to the fact that you're "searching" a wide space. --- appa > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,199902,201299#msg-201299 > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx From astarr at wiredquote.com Fri May 27 01:06:28 2011 From: astarr at wiredquote.com (Aaron Starr) Date: Thu, 26 May 2011 14:06:28 -0700 Subject: Sanity check of my config - is it secure? In-Reply-To: <87hb8hjir4.wl%appa@perusio.net> References: <87k4ddjjrq.wl%appa@perusio.net> <56b117011b76c1e7bf01d0db1635ba95.NginxMailingListEnglish@forum.nginx.org> <87hb8hjir4.wl%appa@perusio.net> Message-ID: Without actually testing anything, can't you do something like this: location ~* \.(jpe?g|png|gif)$ { } location / { return 444; } I.e., if the extension looks like an image, handle it normally. Otherwise, in the normal case, return 444 (or whatever error code is appropriate). Aaron On Thu, May 26, 2011 at 1:42 PM, Ant?nio P. P. Almeida wrote: > On 26 Mai 2011 21h30 WEST, nginx-forum at nginx.us wrote: > > > Thanks for the advice > > > > Seems strange that this isn't an easy thing to do. After all, ALL > > security advise always recommends whitelisting what you want and > > denying everything else! > > The config with two regex locations nested did that. But if you're > asking for a *catch all* regex that blocks every other extension > besides css, js, &c, then you're thinking in terms of the > complement of the set of allowed extensions. > > It's easier to enunciate the negative than the positivem due to the > fact that you're "searching" a wide space. > > --- appa > > > > > > Posted at Nginx Forum: > > http://forum.nginx.org/read.php?2,199902,201299#msg-201299 > > > > > > _______________________________________________ > > nginx mailing list > > nginx at nginx.org > > http://nginx.org/mailman/listinfo/nginx > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri May 27 01:09:04 2011 From: nginx-forum at nginx.us (benseb) Date: Thu, 26 May 2011 17:09:04 -0400 Subject: Sanity check of my config - is it secure? In-Reply-To: References: Message-ID: That would be a nice simple solution. I'll give that a go! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,199902,201314#msg-201314 From nginx-forum at nginx.us Fri May 27 04:28:56 2011 From: nginx-forum at nginx.us (adamchal) Date: Thu, 26 May 2011 20:28:56 -0400 Subject: cache gzipped content with proxy_pass In-Reply-To: References: Message-ID: I've been following this discussion and I'm anxiously waiting for some resolution. I think Maxim's approach is right: implementing a gzip_cache filter that could be used for caching any content. This would allow for much more flexibility than just using it for proxy_pass/proxy_cache. This could effectively eliminate the gzip_static filter. If you have plain HTML served and "gzip on;" plus something like "gzip_cache on;" all of your plain text content would be served using the cached gzip content. Similarly, you would be able to use this for proxy_pass, proxy_store, fastcgi_pass, etc. It wouldn't matter since the caching of the gzip'd content would be stored in the gzip_cache filter and negotiated directly with the client. There's a lot of chatter about using Varnish or Lighty or to give Nginx pre-gzipped data in a proxy response. This sounds absolutely horrible. The bottom line is that if Nginx is the webserver that is dealing with the client directly, it should then be Nginx's responsibility to serve the appropriate version (gzip'd or plain text) content based on the client's request headers. That being said, Nginx should be managing it's own cache of filtered items. The same goes for the image_filter. Currently, I use the image_filter for a project and I'm bummed out that Nginx is scaling the same image over and over each time it is requested. An image_filter_cache would be another great feature. Am I on the right track? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,120314,201370#msg-201370 From baalchina at gmail.com Fri May 27 07:26:24 2011 From: baalchina at gmail.com (baalchina) Date: Fri, 27 May 2011 11:26:24 +0800 Subject: nginx 1.0.3 with php-fpm, php report 404 error Message-ID: Hi everyone I am using nginx 1.0.3 under CentOS 5.6, with php-fpm. nginx works fine with static file, such as html,txt. But not with php file. I wrote a phpinfo.php file in my webserver, my browser and nginx log both report an 404 error. I changed nothing but only add below in my nginx.conf file: *location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include /usr/local/nginx/conf/fastcgi.conf; }* this is fastcgi.conf: * fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; # PHP only, required if PHP was built with --enable-force-cgi-redirect #fastcgi_param REDIRECT_STATUS 200;* and php-fm works fine: *[root at cacti database]# more /data/logs/php-fpm.log [27-May-2011 10:04:51] NOTICE: configuration file /usr/local/php/etc/php-fpm.conf test is successful [27-May-2011 10:07:14] NOTICE: using inherited socket fd=6, "127.0.0.1:9000" [27-May-2011 10:07:14] NOTICE: fpm is running, pid 25610 [27-May-2011 10:07:14] NOTICE: ready to handle connections* and this is nginx access log: *172.17.188.133 - - [27/May/2011:10:46:37 +0800] "GET /info.php HTTP/1.1" 404 5 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0. 1"* so, what is the problely problem of this 404 error? thanks! -- from:baalchina -------------- next part -------------- An HTML attachment was scrubbed... URL: From edhoprima at gmail.com Fri May 27 07:43:04 2011 From: edhoprima at gmail.com (Edho P Arief) Date: Fri, 27 May 2011 10:43:04 +0700 Subject: nginx 1.0.3 with php-fpm, php report 404 error In-Reply-To: References: Message-ID: On Fri, May 27, 2011 at 10:26 AM, baalchina wrote: > Hi everyone > > I am using nginx 1.0.3 under CentOS 5.6, with php-fpm. > > nginx works fine with static file, such as html,txt. But not with php file. > > I wrote a phpinfo.php file in my webserver, my browser? and nginx log both > report an 404 error. > did you set root parameter in location block (eg. location / { .. }) or in server block (server { ... })? You must set it in server block if you want the location php to use the root or else it'll use default root. Checking error log could also show you where nginx tried to find the file. From mat999 at gmail.com Fri May 27 07:48:21 2011 From: mat999 at gmail.com (SplitIce) Date: Fri, 27 May 2011 13:48:21 +1000 Subject: cache gzipped content with proxy_pass In-Reply-To: References: Message-ID: You can cache the image filter using either lua or through a proxy pass to yourself. But yes I agree with your points. On Fri, May 27, 2011 at 10:28 AM, adamchal wrote: > I've been following this discussion and I'm anxiously waiting for some > resolution. I think Maxim's approach is right: implementing a > gzip_cache filter that could be used for caching any content. This > would allow for much more flexibility than just using it for > proxy_pass/proxy_cache. > > This could effectively eliminate the gzip_static filter. If you have > plain HTML served and "gzip on;" plus something like "gzip_cache on;" > all of your plain text content would be served using the cached gzip > content. Similarly, you would be able to use this for proxy_pass, > proxy_store, fastcgi_pass, etc. It wouldn't matter since the caching of > the gzip'd content would be stored in the gzip_cache filter and > negotiated directly with the client. > > There's a lot of chatter about using Varnish or Lighty or another web/cache server here> to give Nginx pre-gzipped data in a proxy > response. This sounds absolutely horrible. The bottom line is that if > Nginx is the webserver that is dealing with the client directly, it > should then be Nginx's responsibility to serve the appropriate version > (gzip'd or plain text) content based on the client's request headers. > That being said, Nginx should be managing it's own cache of filtered > items. > > The same goes for the image_filter. Currently, I use the image_filter > for a project and I'm bummed out that Nginx is scaling the same image > over and over each time it is requested. An image_filter_cache would be > another great feature. > > Am I on the right track? > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?2,120314,201370#msg-201370 > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -- Warez Scene Free Rapidshare Downloads -------------- next part -------------- An HTML attachment was scrubbed... URL: From julyclyde at gmail.com Fri May 27 07:55:25 2011 From: julyclyde at gmail.com (=?GB2312?B?yM7P/sDa?=) Date: Fri, 27 May 2011 11:55:25 +0800 Subject: nginx 1.0.3 with php-fpm, php report 404 error In-Reply-To: References: Message-ID: <1ADBE276-9B97-47BE-892E-A8506035D1DA@gmail.com> location ~ \.php$ should be a part of location / Or else, nginx cannot determine $document_root ? 2011-5-27???11:26? baalchina ??? > Hi everyone > > I am using nginx 1.0.3 under CentOS 5.6, with php-fpm. > > nginx works fine with static file, such as html,txt. But not with php file. > > I wrote a phpinfo.php file in my webserver, my browser and nginx log both report an 404 error. > > I changed nothing but only add below in my nginx.conf file: > > location ~ \.php$ { > > fastcgi_pass 127.0.0.1:9000; > fastcgi_index index.php; > include /usr/local/nginx/conf/fastcgi.conf; > } > > this is fastcgi.conf: > > fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; > > > fastcgi_param QUERY_STRING $query_string; > fastcgi_param REQUEST_METHOD $request_method; > fastcgi_param CONTENT_TYPE $content_type; > fastcgi_param CONTENT_LENGTH $content_length; > > fastcgi_param SCRIPT_NAME $fastcgi_script_name; > fastcgi_param REQUEST_URI $request_uri; > fastcgi_param DOCUMENT_URI $document_uri; > fastcgi_param DOCUMENT_ROOT $document_root; > fastcgi_param SERVER_PROTOCOL $server_protocol; > > fastcgi_param GATEWAY_INTERFACE CGI/1.1; > fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; > > fastcgi_param REMOTE_ADDR $remote_addr; > fastcgi_param REMOTE_PORT $remote_port; > fastcgi_param SERVER_ADDR $server_addr; > fastcgi_param SERVER_PORT $server_port; > fastcgi_param SERVER_NAME $server_name; > > # PHP only, required if PHP was built with --enable-force-cgi-redirect > #fastcgi_param REDIRECT_STATUS 200; > > and php-fm works fine: > [root at cacti database]# more /data/logs/php-fpm.log > [27-May-2011 10:04:51] NOTICE: configuration file /usr/local/php/etc/php-fpm.conf test is successful > > [27-May-2011 10:07:14] NOTICE: using inherited socket fd=6, "127.0.0.1:9000" > [27-May-2011 10:07:14] NOTICE: fpm is running, pid 25610 > [27-May-2011 10:07:14] NOTICE: ready to handle connections > > and this is nginx access log: > > > 172.17.188.133 - - [27/May/2011:10:46:37 +0800] "GET /info.php HTTP/1.1" 404 5 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0. > 1" > > so, what is the problely problem of this 404 error? > > thanks! > -- > from:baalchina > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx -------------- next part -------------- An HTML attachment was scrubbed... URL: From baalchina at gmail.com Fri May 27 08:11:48 2011 From: baalchina at gmail.com (baalchina) Date: Fri, 27 May 2011 12:11:48 +0800 Subject: nginx 1.0.3 with php-fpm, php report 404 error In-Reply-To: <1ADBE276-9B97-47BE-892E-A8506035D1DA@gmail.com> References: <1ADBE276-9B97-47BE-892E-A8506035D1DA@gmail.com> Message-ID: thanks! I moved location ~\.php to location \,works fine now. 2011/5/27 ??? > location ~ \.php$ should be a part of location / > Or else, nginx cannot determine $document_root > > > ? 2011-5-27???11:26? baalchina ??? > > Hi everyone > > I am using nginx 1.0.3 under CentOS 5.6, with php-fpm. > > nginx works fine with static file, such as html,txt. But not with php file. > > I wrote a phpinfo.php file in my webserver, my browser and nginx log both > report an 404 error. > > I changed nothing but only add below in my nginx.conf file: > > *location ~ \.php$ { > > fastcgi_pass 127.0.0.1:9000; > fastcgi_index index.php; > include /usr/local/nginx/conf/fastcgi.conf; > }* > > this is fastcgi.conf: > * > fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; > > > fastcgi_param QUERY_STRING $query_string; > fastcgi_param REQUEST_METHOD $request_method; > fastcgi_param CONTENT_TYPE $content_type; > fastcgi_param CONTENT_LENGTH $content_length; > > fastcgi_param SCRIPT_NAME $fastcgi_script_name; > fastcgi_param REQUEST_URI $request_uri; > fastcgi_param DOCUMENT_URI $document_uri; > fastcgi_param DOCUMENT_ROOT $document_root; > fastcgi_param SERVER_PROTOCOL $server_protocol; > > fastcgi_param GATEWAY_INTERFACE CGI/1.1; > fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; > > fastcgi_param REMOTE_ADDR $remote_addr; > fastcgi_param REMOTE_PORT $remote_port; > fastcgi_param SERVER_ADDR $server_addr; > fastcgi_param SERVER_PORT $server_port; > fastcgi_param SERVER_NAME $server_name; > > # PHP only, required if PHP was built with --enable-force-cgi-redirect > #fastcgi_param REDIRECT_STATUS 200;* > > and php-fm works fine: > *[root at cacti database]# more /data/logs/php-fpm.log > [27-May-2011 10:04:51] NOTICE: configuration file > /usr/local/php/etc/php-fpm.conf test is successful > > [27-May-2011 10:07:14] NOTICE: using inherited socket fd=6, " > 127.0.0.1:9000" > [27-May-2011 10:07:14] NOTICE: fpm is running, pid 25610 > [27-May-2011 10:07:14] NOTICE: ready to handle connections* > > and this is nginx access log: > > > *172.17.188.133 - - [27/May/2011:10:46:37 +0800] "GET /info.php HTTP/1.1" > 404 5 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 > Firefox/4.0. > 1"* > > so, what is the problely problem of this 404 error? > > thanks! > -- > from:baalchina > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > > -- from:baalchina -------------- next part -------------- An HTML attachment was scrubbed... URL: From josh at joshparker.us Fri May 27 08:17:10 2011 From: josh at joshparker.us (=?utf-8?Q?Parker=2C_Joshua?=) Date: Fri, 27 May 2011 00:17:10 -0400 Subject: SMTP or POP3 Authentication Message-ID: <6C6276B0EF904519A3133AB1D85ED644@joshparker.us> I am trying to use smtp connection for an email marketing software and would like to use smtp or pop3, but I am not sure where to start. I have mailauth.pm in /root/auth/ but I am not sure if that is write. If the previous is correct, is this also correct in nginx.conf: mail { auth_http 127.0.0.1:80/auth; pop3_capabilities "TOP" "USER"; smtp_auth plain login; server { listen 110; protocol pop3; proxy on; } } If none of the above is correct, can you point me in the write direction or documentation on how to accomplish this? Thanks. -- Parker, Joshua Sent with Sparrow (http://www.sparrowmailapp.com/?sig) -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Fri May 27 08:49:30 2011 From: nginx-forum at nginx.us (speedfirst) Date: Fri, 27 May 2011 00:49:30 -0400 Subject: How to add cookie when proxy_pass via programming? Message-ID: <3dc5bd76bbf522bacd924a5f91ecc262.NginxMailingListEnglish@forum.nginx.org> Hey, I want to add custom cookie when proxy pass to the upstream in my custom module. I want to implement like what this config does: proxy_pass http://servers; proxy_add_header Cookie "$http_cookie;KEY=VALUE"; But sinc the VALUE is dynamically generated so I need to add this cookie via programming. How to do that? Thanks very much. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,201413,201413#msg-201413 From igor at sysoev.ru Fri May 27 09:39:10 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 27 May 2011 09:39:10 +0400 Subject: Sanity check of my config - is it secure? In-Reply-To: References: <3ce420be0701a81ea969389d395b6a49.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110527053910.GE79260@sysoev.ru> On Sun, May 22, 2011 at 05:48:42PM +0100, Nuno Magalh?es wrote: > > ? ? ? ? location ^~ /applets/{ > > ? ? ? ? ? ? ? root /home/vhosts/x.com/httpdocs; > > ? ? ? ? ? ? ? expires max; > > ? ? ? ?} > > ? ? ? ?location ^~ /css/{ > > ? ? ? ? ? ? ? root /home/vhosts/x.com/httpdocs; > > ? ? ? ? ? ? ? expires max; > > ? ? ? ?} > > And merge these locations (as well as others) perhaps? Something like > ^~ /(applets|css)/ The lesser regex locaitons you have in configuraiton is the better. The best case is zero regex locations. -- Igor Sysoev From igor at sysoev.ru Fri May 27 09:41:02 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 27 May 2011 09:41:02 +0400 Subject: Sanity check of my config - is it secure? In-Reply-To: <3538d29804bc922548e34af913cb5963.NginxMailingListEnglish@forum.nginx.org> References: <87oc2pjlcl.wl%appa@perusio.net> <4eeedadeefe2d50b4c7c7b3e3f487255.NginxMailingListEnglish@forum.nginx.org> <3538d29804bc922548e34af913cb5963.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110527054102.GF79260@sysoev.ru> On Thu, May 26, 2011 at 04:10:23PM -0400, benseb wrote: > Thanks people > > So there's no way to say "If the file ISNT a jpeg/gif/css/js" deny. The > only way is to say 'if .php' deny, 'if .txt deny' etc? > > I'd prefer to whitelist the files i DO want to return and block > everything else, incase I forget something to block? As it was already suggested: location ~* \.(jpe?g|png|gif)$ { root ... } location / { return 444; } -- Igor Sysoev From igor at sysoev.ru Fri May 27 12:00:55 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 27 May 2011 12:00:55 +0400 Subject: How to add cookie when proxy_pass via programming? In-Reply-To: <3dc5bd76bbf522bacd924a5f91ecc262.NginxMailingListEnglish@forum.nginx.org> References: <3dc5bd76bbf522bacd924a5f91ecc262.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110527080055.GI79260@sysoev.ru> On Fri, May 27, 2011 at 12:49:30AM -0400, speedfirst wrote: > Hey, I want to add custom cookie when proxy pass to the upstream in my > custom module. I want to implement like what this config does: > > proxy_pass http://servers; > proxy_add_header Cookie "$http_cookie;KEY=VALUE"; > > But sinc the VALUE is dynamically generated so I need to add this cookie > via programming. > > How to do that? Create a module that defines a veriable and use it in proxy_set_header Cookie "$http_cookie; key=$var"; -- Igor Sysoev From igor at sysoev.ru Fri May 27 12:10:50 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 27 May 2011 12:10:50 +0400 Subject: SMTP or POP3 Authentication In-Reply-To: <6C6276B0EF904519A3133AB1D85ED644@joshparker.us> References: <6C6276B0EF904519A3133AB1D85ED644@joshparker.us> Message-ID: <20110527081050.GA95514@sysoev.ru> On Fri, May 27, 2011 at 12:17:10AM -0400, Parker, Joshua wrote: > I am trying to use smtp connection for an email marketing software and would like to use smtp or pop3, but I am not sure where to start. I have mailauth.pm in /root/auth/ but I am not sure if that is write. If the previous is correct, is this also correct in nginx.conf: > > mail { auth_http 127.0.0.1:80/auth; pop3_capabilities "TOP" "USER"; > smtp_auth plain login; server { listen 110; protocol pop3; proxy on; } } > > If none of the above is correct, can you point me in the write direction or documentation on how to accomplish this? Thanks. nginx can not work as SMTP or POP3 server, it can only proxy connections to real mail servers. -- Igor Sysoev From nginx-forum at nginx.us Fri May 27 12:14:49 2011 From: nginx-forum at nginx.us (pk899) Date: Fri, 27 May 2011 04:14:49 -0400 Subject: Newbie questions about nginx (moving from apache) Message-ID: <6f56cffc73aa96c01438b44bd1386150.NginxMailingListEnglish@forum.nginx.org> Hi sorry for english. i am on centos 64 bit server with cpanel and whm. i have apache 2.2.18 and there is heavy duty use of the following: 1. mod rewrite 2. mod geoip 3. mod security (with rules available in 2.6.0 for google safe browsing checks etc) 4. mod evasive 5. php5 functionality with memcached + eaccelerator for #1, i see from threads on this phorum that some rewriting functionality is possible. i also see that in 1.0.3 the #2 of geoip is possible. but i am not sure about 3, 4 and 5. nginx does not support DDOS protection right? also, will all the php5 modules work with pecl such as memcached etc? in trying to set up nginx, i have problem getting php to work. mod fcgi -- is there simple instruction about how to do, and how is the performance when compared to apache+eaccelerator which opcode caches? because of this functionality, i don't want to move entire to nginx. so i am trying this: nginx run on localhost on port 81. apache is main front server on port 80. all static content from images folder need to pass to nginx. i am trying this code in apache: ProxyRequests Off ProxyPreserveHost On ProxyPass /mysite/images http://0.0.0.0:81/ ProxyPassReverse / http://0.0.0.0:81/ But this is not working. Nginx root folder is "/mysite/images". And when I type in browser http://MYDOMAIN.COM:81 then I can see the nginx working fine. the images are there. any idea about how i can make this setup work? or ideally, over time i want to move entirely to nginx. so would appreciate some experienced thought or guidance. thanks Posted at Nginx Forum: http://forum.nginx.org/read.php?2,201449,201449#msg-201449 From igor at sysoev.ru Fri May 27 12:24:14 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 27 May 2011 12:24:14 +0400 Subject: Newbie questions about nginx (moving from apache) In-Reply-To: <6f56cffc73aa96c01438b44bd1386150.NginxMailingListEnglish@forum.nginx.org> References: <6f56cffc73aa96c01438b44bd1386150.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110527082414.GB95514@sysoev.ru> On Fri, May 27, 2011 at 04:14:49AM -0400, pk899 wrote: > Hi > > sorry for english. > > i am on centos 64 bit server with cpanel and whm. > > i have apache 2.2.18 and there is heavy duty use of the following: > > 1. mod rewrite > 2. mod geoip > 3. mod security (with rules available in 2.6.0 for google safe browsing > checks etc) > 4. mod evasive > 5. php5 functionality with memcached + eaccelerator > > for #1, i see from threads on this phorum that some rewriting > functionality is possible. i also see that in 1.0.3 the #2 of geoip is > possible. > > but i am not sure about 3, 4 and 5. nginx does not support DDOS > protection right? also, will all the php5 modules work with pecl such as > memcached etc? > > in trying to set up nginx, i have problem getting php to work. mod fcgi > -- is there simple instruction about how to do, and how is the > performance when compared to apache+eaccelerator which opcode caches? > > because of this functionality, i don't want to move entire to nginx. > > so i am trying this: nginx run on localhost on port 81. apache is main > front server on port 80. all static content from images folder need to > pass to nginx. i am trying this code in apache: > > > ProxyRequests Off > ProxyPreserveHost On > ProxyPass /mysite/images http://0.0.0.0:81/ > ProxyPassReverse / http://0.0.0.0:81/ > > > But this is not working. > > Nginx root folder is "/mysite/images". And when I type in browser > http://MYDOMAIN.COM:81 then I can see the nginx working fine. the images > are there. > > any idea about how i can make this setup work? > > or ideally, over time i want to move entirely to nginx. so would > appreciate some experienced thought or guidance. You should use 127.0.0.1:81 instead of 0.0.0.0:81. However, it's better to set nginx before Apache and all except "/mysite/images" to the Apache. nginx has not mod_security functionality. There is some functionality similar to mod_evasive in limit_req. -- Igor Sysoev From nginx-forum at nginx.us Fri May 27 12:28:10 2011 From: nginx-forum at nginx.us (pk899) Date: Fri, 27 May 2011 04:28:10 -0400 Subject: Newbie questions about nginx (moving from apache) In-Reply-To: <20110527082414.GB95514@sysoev.ru> References: <20110527082414.GB95514@sysoev.ru> Message-ID: <7222f6608bdfa123403f17dbd24ae2ca.NginxMailingListEnglish@forum.nginx.org> thanks igor. wow, so fast reply. how can i setup nginx "before apache"? will i have to change apache port? and what will the syntax look like. is there any simple guide? i have a high traffic site so dont want to break the functionality. thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,201449,201454#msg-201454 From igor at sysoev.ru Fri May 27 12:34:14 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 27 May 2011 12:34:14 +0400 Subject: Newbie questions about nginx (moving from apache) In-Reply-To: <7222f6608bdfa123403f17dbd24ae2ca.NginxMailingListEnglish@forum.nginx.org> References: <20110527082414.GB95514@sysoev.ru> <7222f6608bdfa123403f17dbd24ae2ca.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110527083414.GC95514@sysoev.ru> On Fri, May 27, 2011 at 04:28:10AM -0400, pk899 wrote: > thanks igor. wow, so fast reply. > > how can i setup nginx "before apache"? will i have to change apache > port? > > and what will the syntax look like. is there any simple guide? i have a > high traffic site so dont want to break the functionality. You should test nginx setup on 81 port passing request to Apache on 80: server { listen 81; server_name your.domain.com; root /path/to/static; location / { proxy_pass http://127.0.0.1; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location /mysite/images/ { } } You may need to add mod_rpaf to Apache to process client IPs passed by nginx in X-Forwarded-For. -- Igor Sysoev From nginx-forum at nginx.us Fri May 27 12:37:43 2011 From: nginx-forum at nginx.us (Allison88) Date: Fri, 27 May 2011 04:37:43 -0400 Subject: Wether Borbon will appear on the court depends on his test on Friday Message-ID: <23a0ce9c48f19d7db4589c84fdd6706f.NginxMailingListEnglish@forum.nginx.org> Julio Borbon will test his inflamed hamstring Friday by running the bases. Borbon has only run at about 60-70 percent this week. If the Friday test goes well, he could begin a rehab assignment over the weekend. Manager Ron Washington said Borbon would not return Sunday, the first day he's eligible. More relate info on [b][url=http://www.texas-rangers-shop.com]Texas Rangers jerseys[/url][/b] zone Posted at Nginx Forum: http://forum.nginx.org/read.php?2,201458,201458#msg-201458 From Dalibor.Jotanovic at herold.at Fri May 27 13:30:17 2011 From: Dalibor.Jotanovic at herold.at (Dalibor Jotanovic) Date: Fri, 27 May 2011 11:30:17 +0200 Subject: =?UTF-8?Q?NGINX_1=2E0=2E3_compile_error=3A_src/core/ngx=5Fcrypt=2Ec=3A_In_?= =?UTF-8?Q?function_=E2=80=98ngx=5Fcrypt=5Fapr1=E2=80=99?= References: <4DDF83280200005E000347A4@mx.herold.at> <4DDF8B490200005E000347B9@mx.herold.at> Message-ID: <4DDF8B490200005E000347B9@mx.herold.at> Hi, i'm having problems compiling the latest stable source 1.0.3. How to reproduce: cd ./configure make make output is attached in log.txt I do not have any problems compiling stable source 1.0.2 Is suspect this issue beeing a bug. Can somebody confirm this? Thanks in advance! Cheers, DJ HEROLD Business Data GmbH Guntramsdorfer Stra?e 105 A-2340 M?dling FN 233171z Landesgericht Wiener Neustadt Besuchen Sie uns online und mobil www.herold.at! Weitere Informationen zu unseren Produkten finden Sie unter: http://mobile.herold.at http://daten.herold.at Werden Sie Fan von HEROLD auf Facebook! Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen: www.clearsense.at www.tupalo.com www.aboutmedia.at www.love.at www.reise-hero.at www.urlauburlaub.at Diese E-Mail kann vertrauliche und/oder rechtlich gesch?tzte Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1993 bytes Desc: CompuServe GIF graphic URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1096 bytes Desc: CompuServe GIF graphic URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: log.txt URL: From nginx-forum at nginx.us Fri May 27 13:32:11 2011 From: nginx-forum at nginx.us (speedfirst) Date: Fri, 27 May 2011 05:32:11 -0400 Subject: How to add cookie when proxy_pass via programming? In-Reply-To: <3dc5bd76bbf522bacd924a5f91ecc262.NginxMailingListEnglish@forum.nginx.org> References: <3dc5bd76bbf522bacd924a5f91ecc262.NginxMailingListEnglish@forum.nginx.org> Message-ID: Thanks. And I want to know the time when "proxy_set_header" is executed, because the my cookie value is related to the chosen upstream server. So will proxy_set_header happen before upstream peer initialization or after that? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,201413,201474#msg-201474 From igor at sysoev.ru Fri May 27 13:44:16 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 27 May 2011 13:44:16 +0400 Subject: How to add cookie when proxy_pass via programming? In-Reply-To: References: <3dc5bd76bbf522bacd924a5f91ecc262.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110527094416.GD95514@sysoev.ru> On Fri, May 27, 2011 at 05:32:11AM -0400, speedfirst wrote: > Thanks. And I want to know the time when "proxy_set_header" is executed, > because the my cookie value is related to the chosen upstream server. So > will proxy_set_header happen before upstream peer initialization or > after that? Before, and this value is used for all upstreams. -- Igor Sysoev From igor at sysoev.ru Fri May 27 13:57:45 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 27 May 2011 13:57:45 +0400 Subject: =?UTF-8?Q?Re=3A_NGINX_1=2E0=2E3_compile_error=3A_src/core/ngx=5Fcrypt=2Ec?= =?UTF-8?Q?=3A_In_function_=E2=80=98ngx=5Fcrypt=5Fapr1=E2=80=99?= In-Reply-To: <4DDF8B490200005E000347B9@mx.herold.at> References: <4DDF83280200005E000347A4@mx.herold.at> <4DDF8B490200005E000347B9@mx.herold.at> <4DDF8B490200005E000347B9@mx.herold.at> Message-ID: <20110527095745.GE95514@sysoev.ru> On Fri, May 27, 2011 at 11:30:17AM +0200, Dalibor Jotanovic wrote: > Hi, > > i'm having problems compiling the latest stable source 1.0.3. > > How to reproduce: > > cd > ./configure > make > > make output is attached in log.txt > > I do not have any problems compiling stable source 1.0.2 > > Is suspect this issue beeing a bug. Can somebody confirm this? > gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I > src/event -I src/event/modules -I src/os/unix -I objs \ > -o objs/src/core/ngx_crypt.o \ > src/core/ngx_crypt.c > cc1: warnings being treated as errors > src/core/ngx_crypt.c: In function ???ngx_crypt_apr1???: > src/core/ngx_crypt.c:76: warning: pointer targets in passing argument 2 of ???ngx_md5_update??? differ in signedness Thank you for the report. The attached patch should fix the issue. -- Igor Sysoev -------------- next part -------------- Index: src/core/ngx_md5.c =================================================================== --- src/core/ngx_md5.c (revision 3927) +++ src/core/ngx_md5.c (working copy) @@ -32,7 +32,7 @@ void -ngx_md5_update(ngx_md5_t *ctx, const u_char *data, size_t size) +ngx_md5_update(ngx_md5_t *ctx, const void *data, size_t size) { size_t used, free; @@ -47,8 +47,7 @@ return; } - ngx_memcpy(&ctx->buffer[used], data, free); - data = (u_char *)data + free; + data = ngx_cpymem(&ctx->buffer[used], data, free); size -= free; (void) ngx_md5_body(ctx, ctx->buffer, 64); } Index: src/core/ngx_md5.h =================================================================== --- src/core/ngx_md5.h (revision 3927) +++ src/core/ngx_md5.h (working copy) @@ -50,7 +50,7 @@ void ngx_md5_init(ngx_md5_t *ctx); -void ngx_md5_update(ngx_md5_t *ctx, const u_char *data, size_t size); +void ngx_md5_update(ngx_md5_t *ctx, const void *data, size_t size); void ngx_md5_final(u_char result[16], ngx_md5_t *ctx); From Dalibor.Jotanovic at herold.at Fri May 27 14:38:36 2011 From: Dalibor.Jotanovic at herold.at (Dalibor Jotanovic) Date: Fri, 27 May 2011 12:38:36 +0200 Subject: =?UTF-8?Q?Antw=3A_Re=3A_NGINX_1=2E0=2E3_compile_error=3A_src/core/ngx=5Fcr?= =?UTF-8?Q?ypt=2Ec=3A_In_function_=E2=80=98ngx=5Fcrypt=5Fapr1=E2=80=99?= In-Reply-To: <20110527095745.GE95514@sysoev.ru> References: <4DDF83280200005E000347A4@mx.herold.at> <4DDF8B490200005E000347B9@mx.herold.at> <4DDF8B490200005E000347B9@mx.herold.at> <20110527095745.GE95514@sysoev.ru> Message-ID: <4DDF9B4C0200005E0003480A@mx.herold.at> Hi, that patch fixed the issue. Many thanks for the very fast support! Regards, DJ >>> Igor Sysoev 5/27/2011 11:57 >>> On Fri, May 27, 2011 at 11:30:17AM +0200, Dalibor Jotanovic wrote: > Hi, > > i'm having problems compiling the latest stable source 1.0.3. > > How to reproduce: > > cd > ./configure > make > > make output is attached in log.txt > > I do not have any problems compiling stable source 1.0.2 > > Is suspect this issue beeing a bug. Can somebody confirm this? > gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I > src/event -I src/event/modules -I src/os/unix -I objs \ > -o objs/src/core/ngx_crypt.o \ > src/core/ngx_crypt.c > cc1: warnings being treated as errors > src/core/ngx_crypt.c: In function ???ngx_crypt_apr1???: > src/core/ngx_crypt.c:76: warning: pointer targets in passing argument 2 of ???ngx_md5_update??? differ in signedness Thank you for the report. The attached patch should fix the issue. -- Igor Sysoev HEROLD Business Data GmbH Guntramsdorfer Stra?e 105 A-2340 M?dling FN 233171z Landesgericht Wiener Neustadt Besuchen Sie uns online und mobil www.herold.at! Weitere Informationen zu unseren Produkten finden Sie unter: http://mobile.herold.at http://daten.herold.at Werden Sie Fan von HEROLD auf Facebook! Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen: www.clearsense.at www.tupalo.com www.aboutmedia.at www.love.at www.reise-hero.at www.urlauburlaub.at Diese E-Mail kann vertrauliche und/oder rechtlich gesch?tzte Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1993 bytes Desc: CompuServe GIF graphic URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1096 bytes Desc: CompuServe GIF graphic URL: From Dalibor.Jotanovic at herold.at Fri May 27 14:43:16 2011 From: Dalibor.Jotanovic at herold.at (Dalibor Jotanovic) Date: Fri, 27 May 2011 12:43:16 +0200 Subject: NGINX loadbalancing ORACLE forms backends? Message-ID: <4DDF9C640200005E0003480F@mx.herold.at> Hi, does anybody have a working setup with NGINX loadbalancing ORACLE FORMS backends? I'm interested in setting up an environment with JSESSION cookie based sticky sessions. Regards, DJ HEROLD Business Data GmbH Guntramsdorfer Stra?e 105 A-2340 M?dling FN 233171z Landesgericht Wiener Neustadt Besuchen Sie uns online und mobil www.herold.at! Weitere Informationen zu unseren Produkten finden Sie unter: http://mobile.herold.at http://daten.herold.at Werden Sie Fan von HEROLD auf Facebook! Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen: www.clearsense.at www.tupalo.com www.aboutmedia.at www.love.at www.reise-hero.at www.urlauburlaub.at Diese E-Mail kann vertrauliche und/oder rechtlich gesch?tzte Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1993 bytes Desc: CompuServe GIF graphic URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1096 bytes Desc: CompuServe GIF graphic URL: From jerome at loyet.net Fri May 27 14:52:09 2011 From: jerome at loyet.net (=?ISO-8859-1?B?Suly9G1lIExveWV0?=) Date: Fri, 27 May 2011 12:52:09 +0200 Subject: NGINX loadbalancing ORACLE forms backends? In-Reply-To: <4DDF9C640200005E0003480F@mx.herold.at> References: <4DDF9C640200005E0003480F@mx.herold.at> Message-ID: Hi have a look on this module I've made: http://code.google.com/p/nginx-sticky-module/ I'm using it in different environments (PHP, tomcat, jboss, ...). It can feet your need. Moreover it's independant from the type of backend you're using. hope this help ++ Jerome 2011/5/27 Dalibor Jotanovic > Hi, > > does anybody have a working setup with NGINX loadbalancing ORACLE FORMS > backends? > I'm interested in setting up an environment with JSESSION cookie based > sticky sessions. > > Regards, > DJ > > > > > > HEROLD Business Data GmbH > Guntramsdorfer Stra?e 105 > A-2340 M?dling > > FN 233171z > Landesgericht Wiener Neustadt > > Besuchen Sie uns online und mobil auf *www.herold.at* > ! > > Weitere Informationen zu unseren Produkten finden Sie unter: > *http://mobile.herold.at* > *http://daten.herold.at * > > Werden Sie Fan von HEROLD auf Facebook! > > > Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen: > *www.clearsense.at * > *www.tupalo.com * > *www.aboutmedia.at* * * > *www.love.at* * * > *www.reise-hero.at* * * > *www.urlauburlaub.at* * > * > > Diese E-Mail kann vertrauliche und/oder rechtlich gesch?tzte Informationen > enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail > irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und > vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte > Weitergabe dieser Mail sind nicht gestattet. > > This e-mail may contain confidential and/or privileged information. If you > are not the intended recipient (or have received this e-mail in error) > please notify the sender immediately and delete this e-mail. Any > unauthorized copying, disclosure or distribution of the material in this > e-mail is strictly forbidden. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1993 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1096 bytes Desc: not available URL: From nbubingo at gmail.com Fri May 27 15:20:31 2011 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Fri, 27 May 2011 19:20:31 +0800 Subject: NGINX loadbalancing ORACLE forms backends? In-Reply-To: <4DDF9C640200005E0003480F@mx.herold.at> References: <4DDF9C640200005E0003480F@mx.herold.at> Message-ID: See also this module: http://code.google.com/p/nginx-upstream-jvm-route/ This module achieves session stickiness with the session cookie. If the session is not in the cookie or URL, the module will be a normal Round-Robin upstream module. 2011/5/27 Dalibor Jotanovic > Hi, > > does anybody have a working setup with NGINX loadbalancing ORACLE FORMS > backends? > I'm interested in setting up an environment with JSESSION cookie based > sticky sessions. > > Regards, > DJ > > > > > > HEROLD Business Data GmbH > Guntramsdorfer Stra?e 105 > A-2340 M?dling > > FN 233171z > Landesgericht Wiener Neustadt > > Besuchen Sie uns online und mobil auf *www.herold.at* > ! > > Weitere Informationen zu unseren Produkten finden Sie unter: > *http://mobile.herold.at* > *http://daten.herold.at * > > Werden Sie Fan von HEROLD auf Facebook! > > > Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen: > *www.clearsense.at * > *www.tupalo.com * > *www.aboutmedia.at* * * > *www.love.at* * * > *www.reise-hero.at* * * > *www.urlauburlaub.at* * > * > > Diese E-Mail kann vertrauliche und/oder rechtlich gesch?tzte Informationen > enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail > irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und > vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte > Weitergabe dieser Mail sind nicht gestattet. > > This e-mail may contain confidential and/or privileged information. If you > are not the intended recipient (or have received this e-mail in error) > please notify the sender immediately and delete this e-mail. Any > unauthorized copying, disclosure or distribution of the material in this > e-mail is strictly forbidden. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Pekka.Panula at sofor.fi Fri May 27 16:02:17 2011 From: Pekka.Panula at sofor.fi (Pekka.Panula at sofor.fi) Date: Fri, 27 May 2011 15:02:17 +0300 Subject: TLS 1.1 and TLS 1.2 possible? Message-ID: I am looking for info is it possible to compile nginx SSL routines with TLS 1.1 and 1.2 support? Is openssl only possible backend for nginx? Terveisin/Regards, Pekka Panula, Sofor Oy - Jatkuvat palvelut -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor at sysoev.ru Fri May 27 16:07:14 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 27 May 2011 16:07:14 +0400 Subject: TLS 1.1 and TLS 1.2 possible? In-Reply-To: References: Message-ID: <20110527120714.GJ95514@sysoev.ru> On Fri, May 27, 2011 at 03:02:17PM +0300, Pekka.Panula at sofor.fi wrote: > I am looking for info is it possible to compile nginx SSL routines with > TLS 1.1 and 1.2 support? Is openssl only possible backend for nginx? Currently nginx supports only OpenSSL and relies OpenSSL TLS suuport. -- Igor Sysoev From mdounin at mdounin.ru Fri May 27 16:07:47 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 27 May 2011 16:07:47 +0400 Subject: =?UTF-8?Q?Re=3A_NGINX_1=2E0=2E3_compile_error=3A_src/core/ngx=5Fcrypt=2Ec?= =?UTF-8?Q?=3A_In_function_=E2=80=98ngx=5Fcrypt=5Fapr1=E2=80=99?= In-Reply-To: <20110527095745.GE95514@sysoev.ru> References: <4DDF83280200005E000347A4@mx.herold.at> <4DDF8B490200005E000347B9@mx.herold.at> <4DDF8B490200005E000347B9@mx.herold.at> <20110527095745.GE95514@sysoev.ru> Message-ID: <20110527120747.GH42265@mdounin.ru> Hello! On Fri, May 27, 2011 at 01:57:45PM +0400, Igor Sysoev wrote: > On Fri, May 27, 2011 at 11:30:17AM +0200, Dalibor Jotanovic wrote: > > Hi, > > > > i'm having problems compiling the latest stable source 1.0.3. > > > > How to reproduce: > > > > cd > > ./configure > > make > > > > make output is attached in log.txt > > > > I do not have any problems compiling stable source 1.0.2 > > > > Is suspect this issue beeing a bug. Can somebody confirm this? > > > gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I > > src/event -I src/event/modules -I src/os/unix -I objs \ > > -o objs/src/core/ngx_crypt.o \ > > src/core/ngx_crypt.c > > cc1: warnings being treated as errors > > src/core/ngx_crypt.c: In function ???ngx_crypt_apr1???: > > src/core/ngx_crypt.c:76: warning: pointer targets in passing argument 2 of ???ngx_md5_update??? differ in signedness > > Thank you for the report. > The attached patch should fix the issue. > > > -- > Igor Sysoev > Index: src/core/ngx_md5.c > =================================================================== > --- src/core/ngx_md5.c (revision 3927) > +++ src/core/ngx_md5.c (working copy) > @@ -32,7 +32,7 @@ > > > void > -ngx_md5_update(ngx_md5_t *ctx, const u_char *data, size_t size) > +ngx_md5_update(ngx_md5_t *ctx, const void *data, size_t size) $ grep MD5Update /usr/include/sys/md5.h void MD5Update (MD5_CTX *, const unsigned char *, unsigned int); So this is required anyway: diff --git a/src/core/ngx_crypt.c b/src/core/ngx_crypt.c --- a/src/core/ngx_crypt.c +++ b/src/core/ngx_crypt.c @@ -74,7 +74,7 @@ ngx_crypt_apr1(ngx_pool_t *pool, u_char ngx_md5_init(&md5); ngx_md5_update(&md5, key, keylen); - ngx_md5_update(&md5, "$apr1$", sizeof("$apr1$") - 1); + ngx_md5_update(&md5, (u_char *) "$apr1$", sizeof("$apr1$") - 1); ngx_md5_update(&md5, salt, saltlen); ngx_md5_init(&ctx1); Sorry for the breakage. BTW, it's probably good idea to finally branch stable-1.0 and start releasing 1.1.*. Maxim Dounin From igor at sysoev.ru Fri May 27 16:18:30 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 27 May 2011 16:18:30 +0400 Subject: =?UTF-8?Q?Re=3A_NGINX_1=2E0=2E3_compile_error=3A_src/core/ngx=5Fcrypt=2Ec?= =?UTF-8?Q?=3A_In_function_=E2=80=98ngx=5Fcrypt=5Fapr1=E2=80=99?= In-Reply-To: <20110527120747.GH42265@mdounin.ru> References: <4DDF83280200005E000347A4@mx.herold.at> <4DDF8B490200005E000347B9@mx.herold.at> <4DDF8B490200005E000347B9@mx.herold.at> <20110527095745.GE95514@sysoev.ru> <20110527120747.GH42265@mdounin.ru> Message-ID: <20110527121830.GK95514@sysoev.ru> On Fri, May 27, 2011 at 04:07:47PM +0400, Maxim Dounin wrote: > > Index: src/core/ngx_md5.c > > =================================================================== > > --- src/core/ngx_md5.c (revision 3927) > > +++ src/core/ngx_md5.c (working copy) > > @@ -32,7 +32,7 @@ > > > > > > void > > -ngx_md5_update(ngx_md5_t *ctx, const u_char *data, size_t size) > > +ngx_md5_update(ngx_md5_t *ctx, const void *data, size_t size) > > $ grep MD5Update /usr/include/sys/md5.h > void MD5Update (MD5_CTX *, const unsigned char *, unsigned int); What OS ? $ man 3 md5 (MacOSX 10.6) [ ... ] #include [ ... ] int MD5_Update(MD5_CTX *c, const void *data, unsigned long len); $ man 3 md5 (FreeBSD 7-8) [ ... ] #include [ ... ] MD5Update(MD5_CTX *context, const void *data, unsigned int len); $ grep MD5Update /usr/include/sys/md5.h void MD5Update (MD5_CTX *, const void *, unsigned int); -- Igor Sysoev From igor at sysoev.ru Fri May 27 16:34:07 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 27 May 2011 16:34:07 +0400 Subject: =?UTF-8?Q?Re=3A_NGINX_1=2E0=2E3_compile_error=3A_src/core/ngx=5Fcrypt=2Ec?= =?UTF-8?Q?=3A_In_function_=E2=80=98ngx=5Fcrypt=5Fapr1=E2=80=99?= In-Reply-To: <20110527121830.GK95514@sysoev.ru> References: <4DDF83280200005E000347A4@mx.herold.at> <4DDF8B490200005E000347B9@mx.herold.at> <4DDF8B490200005E000347B9@mx.herold.at> <20110527095745.GE95514@sysoev.ru> <20110527120747.GH42265@mdounin.ru> <20110527121830.GK95514@sysoev.ru> Message-ID: <20110527123407.GL95514@sysoev.ru> On Fri, May 27, 2011 at 04:18:30PM +0400, Igor Sysoev wrote: > On Fri, May 27, 2011 at 04:07:47PM +0400, Maxim Dounin wrote: > > > > Index: src/core/ngx_md5.c > > > =================================================================== > > > --- src/core/ngx_md5.c (revision 3927) > > > +++ src/core/ngx_md5.c (working copy) > > > @@ -32,7 +32,7 @@ > > > > > > > > > void > > > -ngx_md5_update(ngx_md5_t *ctx, const u_char *data, size_t size) > > > +ngx_md5_update(ngx_md5_t *ctx, const void *data, size_t size) > > > > $ grep MD5Update /usr/include/sys/md5.h > > void MD5Update (MD5_CTX *, const unsigned char *, unsigned int); > > What OS ? > > $ man 3 md5 (MacOSX 10.6) > [ ... ] > #include > [ ... ] > int MD5_Update(MD5_CTX *c, const void *data, > unsigned long len); > > $ man 3 md5 (FreeBSD 7-8) > [ ... ] > #include > [ ... ] > MD5Update(MD5_CTX *context, const void *data, unsigned int len); > > $ grep MD5Update /usr/include/sys/md5.h > void MD5Update (MD5_CTX *, const void *, unsigned int); It seems you looked at FreeBSD prior to 7.0-CURRENT, this has been changed on 17.01.2006. -- Igor Sysoev From mdounin at mdounin.ru Fri May 27 16:36:22 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Fri, 27 May 2011 16:36:22 +0400 Subject: =?UTF-8?Q?Re=3A_NGINX_1=2E0=2E3_compile_error=3A_src/core/ngx=5Fcrypt=2Ec?= =?UTF-8?Q?=3A_In_function_=E2=80=98ngx=5Fcrypt=5Fapr1=E2=80=99?= In-Reply-To: <20110527121830.GK95514@sysoev.ru> References: <4DDF83280200005E000347A4@mx.herold.at> <4DDF8B490200005E000347B9@mx.herold.at> <4DDF8B490200005E000347B9@mx.herold.at> <20110527095745.GE95514@sysoev.ru> <20110527120747.GH42265@mdounin.ru> <20110527121830.GK95514@sysoev.ru> Message-ID: <20110527123621.GI42265@mdounin.ru> Hello! On Fri, May 27, 2011 at 04:18:30PM +0400, Igor Sysoev wrote: > On Fri, May 27, 2011 at 04:07:47PM +0400, Maxim Dounin wrote: > > > > Index: src/core/ngx_md5.c > > > =================================================================== > > > --- src/core/ngx_md5.c (revision 3927) > > > +++ src/core/ngx_md5.c (working copy) > > > @@ -32,7 +32,7 @@ > > > > > > > > > void > > > -ngx_md5_update(ngx_md5_t *ctx, const u_char *data, size_t size) > > > +ngx_md5_update(ngx_md5_t *ctx, const void *data, size_t size) > > > > $ grep MD5Update /usr/include/sys/md5.h > > void MD5Update (MD5_CTX *, const unsigned char *, unsigned int); > > What OS ? FreeBSD 6. This was changed in 7+, see http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/sys/md5.h#rev1.19 Maxim Dounin From nginx-forum at nginx.us Fri May 27 18:59:41 2011 From: nginx-forum at nginx.us (kheraud) Date: Fri, 27 May 2011 10:59:41 -0400 Subject: Reverse proxy to a tomcat service (folder name) Message-ID: <66af54152e33276572536226ae532b7b.NginxMailingListEnglish@forum.nginx.org> Hello, I am breaking my head against the wall since his morning on this issue maybe you can help me. I have a single physical server hosting tomcat WARs and also other standalone services. I use subdomains and Nginx to route to the requested service. Tomcat append to URIs the name of the deployed WAR. For example, if I deploy myApp.war on my tomcat server, I can access it through http://mydomain.com:8080/myApp/. What I want is to acces my service through http://myApp.domain.com and navigate my service AND whitout having http://myApp.domain.com/myApp/ ! I wrote this conf : server { server_name myapp.domain.com; root /var/lib/tomcat7/webapps/myapp; access_log /var/log/nginx/myapp.domain.com_access.log; error_log /var/log/nginx/myapp.domain.com_error.log; location / { proxy_pass http://localhost:8080/myapp; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location /myapp { proxy_pass http://localhost:8080/myapp; 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; } } If I access http://myapp.domain.com/, my browser rewrites this url to http://myapp.domain.com/myapp/. I would like to avoid the /myapp/ repeated. Do you have hints or comments to help me ? Thanks a lot Posted at Nginx Forum: http://forum.nginx.org/read.php?2,201561,201561#msg-201561 From igor at sysoev.ru Fri May 27 19:11:08 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 27 May 2011 19:11:08 +0400 Subject: Reverse proxy to a tomcat service (folder name) In-Reply-To: <66af54152e33276572536226ae532b7b.NginxMailingListEnglish@forum.nginx.org> References: <66af54152e33276572536226ae532b7b.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110527151108.GA46101@sysoev.ru> On Fri, May 27, 2011 at 10:59:41AM -0400, kheraud wrote: > Hello, > > I am breaking my head against the wall since his morning on this issue > maybe you can help me. > > I have a single physical server hosting tomcat WARs and also other > standalone services. I use subdomains and Nginx to route to the > requested service. > Tomcat append to URIs the name of the deployed WAR. For example, if I > deploy myApp.war on my tomcat server, I can access it through > http://mydomain.com:8080/myApp/. > What I want is to acces my service through http://myApp.domain.com and > navigate my service AND whitout having http://myApp.domain.com/myApp/ ! > > I wrote this conf : > > server { > server_name myapp.domain.com; > root /var/lib/tomcat7/webapps/myapp; > access_log /var/log/nginx/myapp.domain.com_access.log; > error_log /var/log/nginx/myapp.domain.com_error.log; > > location / { > proxy_pass http://localhost:8080/myapp; > proxy_redirect off; > proxy_set_header Host $host; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For > $proxy_add_x_forwarded_for; > } > > location /myapp { > proxy_pass http://localhost:8080/myapp; > 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; > } > } > > If I access http://myapp.domain.com/, my browser rewrites this url to > http://myapp.domain.com/myapp/. I would like to avoid the /myapp/ > repeated. > > Do you have hints or comments to help me ? Probably this: location / { proxy_pass http://myapp.domain.com:8080/myapp/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; sub_filter /myapp/ /; } -- Igor Sysoev From nginx-forum at nginx.us Fri May 27 20:19:47 2011 From: nginx-forum at nginx.us (pk899) Date: Fri, 27 May 2011 12:19:47 -0400 Subject: Newbie questions about nginx (moving from apache) In-Reply-To: <7222f6608bdfa123403f17dbd24ae2ca.NginxMailingListEnglish@forum.nginx.org> References: <20110527082414.GB95514@sysoev.ru> <7222f6608bdfa123403f17dbd24ae2ca.NginxMailingListEnglish@forum.nginx.org> Message-ID: thanks for this. but before I try all this on a production server, couple questions: 1. if this works with NGINX on port 81, can this work in the future on port 80? So will nginx and apache both be on port 80? I doubt it but want to confirm. 2. secondly, do you have a production-ready sample of how to set up for static serving? in apache for example, we set max-age, expires, gzip, cache-control etc for static files and this is very handy. i read the wiki manual for nginx and there's a lot of options in nginx too (quite impressive actually) but i would love to see a production recommended sample of commands. thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,201449,201595#msg-201595 From treomon at gmail.com Fri May 27 20:24:09 2011 From: treomon at gmail.com (Mon Yang) Date: Fri, 27 May 2011 09:24:09 -0700 Subject: Web Server Internal IP Address/Internal Network Name Disclosure Vulnerability Message-ID: Hi, I did QualysGuard scan and it says "Web Server Internal IP Address/Internal Network Name Disclosure Vulnerability". It suggest for Apache, I need to: For Apache Web Server: Modify the Apache configuration file as follows: - Set "ServerName" to a proper FQDN. or - Use module mod_rewrite to modify the 3xx error message returned by the server. So what I need to do in nginx to fix this issue? Thank you. From nginx-forum at nginx.us Fri May 27 20:26:47 2011 From: nginx-forum at nginx.us (kheraud) Date: Fri, 27 May 2011 12:26:47 -0400 Subject: Reverse proxy to a tomcat service (folder name) In-Reply-To: <66af54152e33276572536226ae532b7b.NginxMailingListEnglish@forum.nginx.org> References: <66af54152e33276572536226ae532b7b.NginxMailingListEnglish@forum.nginx.org> Message-ID: <9fd495e26490b071d3cf413155011172.NginxMailingListEnglish@forum.nginx.org> Thank you for the hint, It seems to work (for the first page) but in fact it leads to some errors... You added "/" to "proxy_pass http://localhost:8080/myapp". But I ommitted it after having seen that it leads to the following mistakes on the tomcat side : The requested resource (/dev01-portal//j_spring_security_check) is not available. The access log is : [27/May/2011:18:23:32 +0200] "POST /dev01-portal/j_spring_security_check HTTP/1.1" 404 441 "http://dev01-portal.appssalon.com/" "Mozilla/5.0 I don't know why but it seems it requests http://localhost:8080/dev01-portal//j_spring_security_check. Do you know where it comes from ? Thanks again for the help Posted at Nginx Forum: http://forum.nginx.org/read.php?2,201561,201598#msg-201598 From igor at sysoev.ru Fri May 27 20:33:07 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 27 May 2011 20:33:07 +0400 Subject: Reverse proxy to a tomcat service (folder name) In-Reply-To: <9fd495e26490b071d3cf413155011172.NginxMailingListEnglish@forum.nginx.org> References: <66af54152e33276572536226ae532b7b.NginxMailingListEnglish@forum.nginx.org> <9fd495e26490b071d3cf413155011172.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110527163307.GD46101@sysoev.ru> On Fri, May 27, 2011 at 12:26:47PM -0400, kheraud wrote: > Thank you for the hint, > > It seems to work (for the first page) but in fact it leads to some > errors... You added "/" to "proxy_pass http://localhost:8080/myapp". But > I ommitted it after having seen that it leads to the following mistakes > on the tomcat side : > > The requested resource (/dev01-portal//j_spring_security_check) is not > available. > > The access log is : > [27/May/2011:18:23:32 +0200] "POST /dev01-portal/j_spring_security_check > HTTP/1.1" 404 441 "http://dev01-portal.appssalon.com/" "Mozilla/5.0 > > I don't know why but it seems it requests > http://localhost:8080/dev01-portal//j_spring_security_check. > > Do you know where it comes from ? It seems you have two locations: location / { location /dev01-portal { You need just one: location / { -- Igor Sysoev From igor at sysoev.ru Fri May 27 20:43:25 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 27 May 2011 20:43:25 +0400 Subject: Newbie questions about nginx (moving from apache) In-Reply-To: References: <20110527082414.GB95514@sysoev.ru> <7222f6608bdfa123403f17dbd24ae2ca.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110527164325.GE46101@sysoev.ru> On Fri, May 27, 2011 at 12:19:47PM -0400, pk899 wrote: > thanks for this. but before I try all this on a production server, > couple questions: > > 1. if this works with NGINX on port 81, can this work in the future on > port 80? So will nginx and apache both be on port 80? I doubt it but > want to confirm. Apache may listen on 127.0.0.1:80, while nginx may listen on *:80. > 2. secondly, do you have a production-ready sample of how to set up for > static serving? in apache for example, we set max-age, expires, gzip, > cache-control etc for static files and this is very handy. i read the > wiki manual for nginx and there's a lot of options in nginx too (quite > impressive actually) but i would love to see a production recommended > sample of commands. location /static/ { root ... expires 30d; gzip on; gzip_static on; } -- Igor Sysoev From igor at sysoev.ru Fri May 27 20:50:54 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Fri, 27 May 2011 20:50:54 +0400 Subject: Web Server Internal IP Address/Internal Network Name Disclosure Vulnerability In-Reply-To: References: Message-ID: <20110527165054.GF46101@sysoev.ru> On Fri, May 27, 2011 at 09:24:09AM -0700, Mon Yang wrote: > Hi, > > I did QualysGuard scan and it says "Web Server Internal IP > Address/Internal Network Name Disclosure Vulnerability". It suggest > for Apache, I need to: > > > For Apache Web Server: > Modify the Apache configuration file as follows: > - Set "ServerName" to a proper FQDN. > or > - Use module mod_rewrite to modify the 3xx error message returned by the server. > > So what I need to do in nginx to fix this issue? Thank you. If you proxy server via nginx, then probably something like this: server { server_name FQDN; location / { proxy_pass http://backend; proxy_redirect http://FQDN/ http://backend/; } } -- Igor Sysoev From nginx-forum at nginx.us Fri May 27 20:59:46 2011 From: nginx-forum at nginx.us (pk899) Date: Fri, 27 May 2011 12:59:46 -0400 Subject: Newbie questions about nginx (moving from apache) In-Reply-To: <6f56cffc73aa96c01438b44bd1386150.NginxMailingListEnglish@forum.nginx.org> References: <6f56cffc73aa96c01438b44bd1386150.NginxMailingListEnglish@forum.nginx.org> Message-ID: <405146017f0e366230d436dba381c983.NginxMailingListEnglish@forum.nginx.org> thanks. i have reading about nginx a lot on the internet. and it seems to me that many features of mod_security are available inside nginx. i like this post: http://eng.eelcowesemann.nl/linux-unix/nginx/nginx-blocking/ my questions. 1. how should i block remote_addr based on IP in a certain external file? 2. to block xss or such type of injection attacks -- any best practice rules? 3. can i block based on "request_uri"? if some hosts are in it (parameter) then block it. 4. can i block based on RBL checks? from spamhaus etc. thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,201449,201617#msg-201617 From jackdesert556 at gmail.com Fri May 27 23:38:18 2011 From: jackdesert556 at gmail.com (Jack Desert) Date: Fri, 27 May 2011 15:38:18 -0400 Subject: Getting All Documentation Under One Roof Message-ID: <20110527153818.2d53fda3@dime> Hi, Can I get a raise of hands who is interested in a more cohesive partnership between these two sites: nginx.org wiki.nginx.org and what thoughts you have on the best way to do it? I'm new to Nginx and this mailing list, but I want to help out with documentation. I spent most of yesterday editing the english wiki at wiki.nginx.org. My goal was to make it as coherent as possible, and add the necessary "Getting Started" links to the various pages since it took me forever to find what I was looking for originally. I also fixed a couple places where if you hit the wrong link it takes you to a page in Russian. The next wave I'd like to pursue is to blend the English wiki and the english nginx.org site into a more cohesive whole. For example, there are only a few official documents in English--and a lot of english info on the wiki. Why not have them both in the same place? Or at least clear links from one to the other. My goal, of course, is for all the newbies out there who come along behind me to be able to find exactly they're looking for on the first try. Jack Desert Technical Writer / Programmer From cliff at develix.com Sat May 28 01:38:54 2011 From: cliff at develix.com (Cliff Wells) Date: Fri, 27 May 2011 14:38:54 -0700 Subject: Getting All Documentation Under One Roof In-Reply-To: <20110527153818.2d53fda3@dime> References: <20110527153818.2d53fda3@dime> Message-ID: <1306532334.31643.6.camel@portable-evil> On Fri, 2011-05-27 at 15:38 -0400, Jack Desert wrote: > Hi, > > > Can I get a raise of hands who is interested in a more cohesive partnership between these two sites: > > nginx.org > wiki.nginx.org > > and what thoughts you have on the best way to do it? Igor writes the documentation on nginx.org. wiki.nginx.org is just that: a wiki, managed by the community. IMO, the best thing if you are seeking some cohesion would be to make sure that docs at nginx.org are properly linked from the wiki and that they don't conflict (some info on wiki is outdated or incomplete). > I'm new to Nginx and this mailing list, but I want to help out with > documentation. I spent most of yesterday editing the english wiki at > wiki.nginx.org. My goal was to make it as coherent as possible, and > add the necessary "Getting Started" links to the various pages since > it took me forever to find what I was looking for originally. Was this due to not knowing the correct search term or something else? > I also fixed a couple places where if you hit the wrong link it takes > you to a page in Russian. > > The next wave I'd like to pursue is to blend the English wiki and the > english nginx.org site into a more cohesive whole. For example, there > are only a few official documents in English--and a lot of english > info on the wiki. Why not have them both in the same place? Or at > least clear links from one to the other. Because one is the official docs and the other is a community wiki. I don't think Igor wants random people editing his documentation, nor do I expect him to update the wiki (that's our job, as users). Links from the wiki to the official docs would be good. > My goal, of course, is for all the newbies out there who come along > behind me to be able to find exactly they're looking for on the first > try. Cliff From ngx.eugaia at gmail.com Sat May 28 02:19:34 2011 From: ngx.eugaia at gmail.com (Eugaia) Date: Sat, 28 May 2011 01:19:34 +0300 Subject: Getting All Documentation Under One Roof In-Reply-To: <1306532334.31643.6.camel@portable-evil> References: <20110527153818.2d53fda3@dime> <1306532334.31643.6.camel@portable-evil> Message-ID: <4DE02376.4040503@gmail.com> Hi, > On Fri, 2011-05-27 at 15:38 -0400, Jack Desert wrote: > > Can I get a raise of hands who is interested in a more cohesive partnership between these two sites: > > nginx.org > wiki.nginx.org > > and what thoughts you have on the best way to do it? I think that it would be good to have a bot automatically check pages on nginx.org, which would add a notification to the wiki.nginx.org site when a new page was added or an existing one was edited. This would probably make it easier for those who wish to keep the wiki up-to-date, since they wouldn't need to search for what needed checking. There could also be a section on the notification page for wiki editors to say that they have looked over the changes and made edits etc, so less duplication of checking is done. If the change notifications could have diff information, or perhaps otherwise identify which configuration directives etc had been added or changed, this would make the task even easier. I agree that linking to the original docs would also be useful. Cheers, Marcus. From nginx-forum at nginx.us Sat May 28 07:54:52 2011 From: nginx-forum at nginx.us (pk899) Date: Fri, 27 May 2011 23:54:52 -0400 Subject: Newbie questions about nginx (moving from apache) In-Reply-To: <6f56cffc73aa96c01438b44bd1386150.NginxMailingListEnglish@forum.nginx.org> References: <6f56cffc73aa96c01438b44bd1386150.NginxMailingListEnglish@forum.nginx.org> Message-ID: <63174a38ac8500e2ac91fc3b3255a650.NginxMailingListEnglish@forum.nginx.org> Some problems with your recommendation, Igor. 1. There is no directive like "gzip_static". 2. The proxy_pass that you recommend above -- this does a full 301 redirect to Apache! This is really not the solution I am after. So, back to my first question, how do I pass the baton from Apache (which really needs to be my first front server because of all the features) only for the static files to nginx? Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,201449,201728#msg-201728 From treomon at gmail.com Sat May 28 08:02:08 2011 From: treomon at gmail.com (Mon Yang) Date: Fri, 27 May 2011 21:02:08 -0700 Subject: Web Server Internal IP Address/Internal Network Name Disclosure Vulnerability In-Reply-To: <20110527165054.GF46101@sysoev.ru> References: <20110527165054.GF46101@sysoev.ru> Message-ID: Sorry... FQDN = nginx server itself or the backend mail server? Or, can you tell me how to change 3xx error message, since it might be safer so it won't break things? Thank you. On Fri, May 27, 2011 at 9:50 AM, Igor Sysoev wrote: > On Fri, May 27, 2011 at 09:24:09AM -0700, Mon Yang wrote: >> Hi, >> >> I did QualysGuard scan and it says "Web Server Internal IP >> Address/Internal Network Name Disclosure Vulnerability". ?It suggest >> for Apache, I need to: >> >> >> For Apache Web Server: >> Modify the Apache configuration file as follows: >> - Set "ServerName" to a proper FQDN. >> or >> - Use module mod_rewrite to modify the 3xx error message returned by the server. >> >> So what I need to do in nginx to fix this issue? ?Thank you. > > If you proxy server via nginx, then probably something like this: > > server { > ? ?server_name ?FQDN; > > ? ?location / { > ? ? ? ?proxy_pass ? ? ?http://backend; > ? ? ? ?proxy_redirect ?http://FQDN/ ?http://backend/; > ? ?} > } > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > From tomlove at gmail.com Sat May 28 17:21:49 2011 From: tomlove at gmail.com (Thomas Love) Date: Sat, 28 May 2011 15:21:49 +0200 Subject: Newbie questions about nginx (moving from apache) In-Reply-To: <405146017f0e366230d436dba381c983.NginxMailingListEnglish@forum.nginx.org> References: <6f56cffc73aa96c01438b44bd1386150.NginxMailingListEnglish@forum.nginx.org> <405146017f0e366230d436dba381c983.NginxMailingListEnglish@forum.nginx.org> Message-ID: On 27 May 2011 18:59, pk899 wrote: > thanks. i have reading about nginx a lot on the internet. and it seems > to me that many features of mod_security are available inside nginx. > > i like this post: > http://eng.eelcowesemann.nl/linux-unix/nginx/nginx-blocking/ > > my questions. > 1. how should i block remote_addr based on IP in a certain external > file? > It's in your link: include /etc/nginx/block.conf; But it's not really nginx's job to secure your server from attackers. Use iptables or similar for that. 2. to block xss or such type of injection attacks -- any best practice > rules? > These are application-level problems (HTML, JS, SQL etc.) and are not specific to your server software. > 3. can i block based on "request_uri"? if some hosts are in it > (parameter) then block it. > http://eng.eelcowesemann.nl/linux-unix/nginx/nginx-blocking/ Use $request_uri instead of $http_referer > 4. can i block based on RBL checks? from spamhaus etc. Not that I know of, and if you are deploying nginx for speed then this is the last job you want to give it. Block proxies/spammers at the application level where posting actually happens (e.g. in postcommentform.php), not for every HTTP request you receive. > thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From tomlove at gmail.com Sat May 28 17:29:57 2011 From: tomlove at gmail.com (Thomas Love) Date: Sat, 28 May 2011 15:29:57 +0200 Subject: Newbie questions about nginx (moving from apache) In-Reply-To: <63174a38ac8500e2ac91fc3b3255a650.NginxMailingListEnglish@forum.nginx.org> References: <6f56cffc73aa96c01438b44bd1386150.NginxMailingListEnglish@forum.nginx.org> <63174a38ac8500e2ac91fc3b3255a650.NginxMailingListEnglish@forum.nginx.org> Message-ID: On 28 May 2011 05:54, pk899 wrote: > Some problems with your recommendation, Igor. > > 1. There is no directive like "gzip_static". > http://wiki.nginx.org/NginxHttpGzipStaticModule > 2. The proxy_pass that you recommend above -- this does a full 301 > redirect to Apache! > This is really not the solution I am after. > > So, back to my first question, how do I pass the baton from Apache > (which really needs to be my first front server because of all the > features) only for the static files to nginx? > Then you set up mod_proxy on Apache instead. But with all due respect I think you're after the wrong solution. You're unlikely to gain any performance like that, because you're still making Apache do all the work of talking to clients and holding keepalives. This is where nginx beats the pants of Apache. Put nginx in front. Test it by starting it on port 81 as suggested previously. When you're happy, switch the ports (nginx on 80, proxying to Apache on 127.0.0.1:81). Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sat May 28 17:31:18 2011 From: nginx-forum at nginx.us (pk899) Date: Sat, 28 May 2011 09:31:18 -0400 Subject: Newbie questions about nginx (moving from apache) In-Reply-To: References: Message-ID: <8adb1101582be7f16c5b6594f1b89dc3.NginxMailingListEnglish@forum.nginx.org> Thanks. The RBL checking in Apache (via mod security) can happen in very specific manner. I could specify that they check only specific arguments (the very precise "input" field in the html) in a very specific page ("postcommentform.php"). Similarly, sure, the application needs to be smartly coded to prevent against injections. But mod_security enables blocking this at a much earlier phase in the web transaction. And it's easy to control this a bit better at the hosting level. Clearly, I am looking at nginx not only as a "speed option", but as a replacement for Apache. Several blogs online say that they have moved to nginx. I am trying to see how. Apache is sadly bloated but thanks to mod_security etc it's a very, very practical modern solution. Anyway, my setup above is not working either. Even just to use nginx as merely a static server. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,201449,201779#msg-201779 From tomlove at gmail.com Sat May 28 17:34:46 2011 From: tomlove at gmail.com (Thomas Love) Date: Sat, 28 May 2011 15:34:46 +0200 Subject: Web Server Internal IP Address/Internal Network Name Disclosure Vulnerability In-Reply-To: References: <20110527165054.GF46101@sysoev.ru> Message-ID: On 28 May 2011 06:02, Mon Yang wrote: > Sorry... FQDN = nginx server itself or the backend mail server? > > nginx server. The full name you would access the site with from the outsite. > Or, can you tell me how to change 3xx error message, since it might be > safer so it won't break things? > > http://wiki.nginx.org/HttpCoreModule#error_page > Thank you. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sat May 28 17:55:10 2011 From: nginx-forum at nginx.us (pk899) Date: Sat, 28 May 2011 09:55:10 -0400 Subject: Newbie questions about nginx (moving from apache) In-Reply-To: References: Message-ID: <35e7eea4725030d90f826fb657beb2d3.NginxMailingListEnglish@forum.nginx.org> Thanks. But I am a bit confused, as the simple setup is not working from port 81 (for testing): server { listen 81; server_name MYDOMAIN.com www.MYDOMAIN.com; location ^~ /site/static { root /home/MYDOMAIN/www/static; index index.htm index.php; expires 30d; gzip on; } location / { proxy_pass http://127.0.0.1:80/; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } Then I try in my browser this: http://MYDOMAIN.com:81/test.gif On the server the "test.gif" file is at "/home/MYDOMAIN/www/static/test.gif". Questions: (1) What am I missing? Should the test.gif file be somewhere else? Should I try this with some other URL instead of the one I mention above? (2) Also, if this worked, and I accepted Nginx to be at the front and moved Apache to the background, isn't it true that Apache would have to pass back all processed output to Nginx? (3) Even with "proxy_redirect off", when I try http://MYDOMAIN.com:81, it actually does a hard 301 redirect to my Apache server. What am I missing? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,201449,201787#msg-201787 From tomlove at gmail.com Sat May 28 17:56:41 2011 From: tomlove at gmail.com (Thomas Love) Date: Sat, 28 May 2011 15:56:41 +0200 Subject: Newbie questions about nginx (moving from apache) In-Reply-To: <8adb1101582be7f16c5b6594f1b89dc3.NginxMailingListEnglish@forum.nginx.org> References: <8adb1101582be7f16c5b6594f1b89dc3.NginxMailingListEnglish@forum.nginx.org> Message-ID: On 28 May 2011 15:31, pk899 wrote: > Thanks. The RBL checking in Apache (via mod security) can happen in very > specific manner. I could specify that they check only specific arguments > (the very precise "input" field in the html) in a very specific page > ("postcommentform.php"). > There is no module like this for nginx that I'm aware of but you can probably find application-level libraries to do it. The fewer conditionals at the HTTP server level the better. > Similarly, sure, the application needs to be smartly coded to prevent > against injections. But mod_security enables blocking this at a much > earlier phase in the web transaction. And it's easy to control this a > bit better at the hosting level. > > If it's important then leave it on Apache with your web application. It will still do what it does upstream of nginx. > Clearly, I am looking at nginx not only as a "speed option", but as a > replacement for Apache. Several blogs online say that they have moved to > nginx. I am trying to see how. Apache is sadly bloated but thanks to > mod_security etc it's a very, very practical modern solution. > IMO its bloat is not helped by being piled with high with modules. This is where nginx comes in, and being relatively free of modules was one of its selling points for me. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tomlove at gmail.com Sat May 28 18:05:38 2011 From: tomlove at gmail.com (Thomas Love) Date: Sat, 28 May 2011 16:05:38 +0200 Subject: Newbie questions about nginx (moving from apache) In-Reply-To: <35e7eea4725030d90f826fb657beb2d3.NginxMailingListEnglish@forum.nginx.org> References: <35e7eea4725030d90f826fb657beb2d3.NginxMailingListEnglish@forum.nginx.org> Message-ID: On 28 May 2011 15:55, pk899 wrote: > Thanks. But I am a bit confused, as the simple setup is not working from > port 81 (for testing): > > > server { > listen 81; > server_name MYDOMAIN.com www.MYDOMAIN.com; > > location ^~ /site/static { > root /home/MYDOMAIN/www/static; > index index.htm index.php; > expires 30d; > gzip on; > } > > location / { > proxy_pass http://127.0.0.1:80/; > proxy_redirect off; > > proxy_set_header Host $host; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > } > > } > > server { listen 81; server_name MYDOMAIN.com www.MYDOMAIN.com ; root /home/MYDOMAIN/www; location / { proxy_pass http://127.0.0.1:80; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location /static/ { index index.htm; expires 30d; gzip on; gzip_static on; } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Sat May 28 18:18:51 2011 From: nginx-forum at nginx.us (pk899) Date: Sat, 28 May 2011 10:18:51 -0400 Subject: Newbie questions about nginx (moving from apache) In-Reply-To: References: Message-ID: <1ef32b04b3a6e62585463e4f71c6aa1e.NginxMailingListEnglish@forum.nginx.org> Thanks. So with this setup, this works: http://mydomain.com:81/static/test.gif But when I try this: http://mydomain.com:81/static/test.gif It physically redirects to http://mydomain.com. How can I avoid this? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,201449,201792#msg-201792 From nginx-forum at nginx.us Sat May 28 18:20:30 2011 From: nginx-forum at nginx.us (pk899) Date: Sat, 28 May 2011 10:20:30 -0400 Subject: Newbie questions about nginx (moving from apache) In-Reply-To: <1ef32b04b3a6e62585463e4f71c6aa1e.NginxMailingListEnglish@forum.nginx.org> References: <1ef32b04b3a6e62585463e4f71c6aa1e.NginxMailingListEnglish@forum.nginx.org> Message-ID: Because this forum does not allow editing, here's my edit: Thanks. So with this setup, this works: http://mydomain.com:81/static/test.gif But when I try this: http://mydomain.com:81/ (main site) It **physically** redirects to http://mydomain.com. How can I avoid this? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,201449,201793#msg-201793 From nginx-forum at nginx.us Sat May 28 18:28:52 2011 From: nginx-forum at nginx.us (pk899) Date: Sat, 28 May 2011 10:28:52 -0400 Subject: Newbie questions about nginx (moving from apache) In-Reply-To: References: Message-ID: <3b8030456b07dfcd74fb2bc67fde0138.NginxMailingListEnglish@forum.nginx.org> Thomas Love Wrote: ------------------------------------------------------- > > 1. how should i block remote_addr based on IP in > a certain external > > file? > > > > It's in your link: include /etc/nginx/block.conf; Not correct. The "block.conf" as that guy mentions is only a collection of rules. I am asking if I can have a file that is full of host names or IPs, say "blacklist.conf". Then, I want to do something like this: if ($request_uri ~* ("/blacklist.conf") ) { return 403; } if ($remote_addr ~* ("/blacklist.conf") ) { return 403; } This way I can keep easily adding or removing IPs/hosts from my blacklist file instead of editing the nginx.conf file every time. Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,201449,201796#msg-201796 From mdounin at mdounin.ru Sat May 28 18:32:35 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Sat, 28 May 2011 18:32:35 +0400 Subject: Newbie questions about nginx (moving from apache) In-Reply-To: <35e7eea4725030d90f826fb657beb2d3.NginxMailingListEnglish@forum.nginx.org> References: <35e7eea4725030d90f826fb657beb2d3.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110528143235.GJ42265@mdounin.ru> Hello! On Sat, May 28, 2011 at 09:55:10AM -0400, pk899 wrote: > Thanks. But I am a bit confused, as the simple setup is not working from > port 81 (for testing): > > > server { > listen 81; > server_name MYDOMAIN.com www.MYDOMAIN.com; > > location ^~ /site/static { > root /home/MYDOMAIN/www/static; > index index.htm index.php; > expires 30d; > gzip on; > } > > location / { > proxy_pass http://127.0.0.1:80/; > proxy_redirect off; > > proxy_set_header Host $host; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > } > > } > > > > Then I try in my browser this: > http://MYDOMAIN.com:81/test.gif > > On the server the "test.gif" file is at > "/home/MYDOMAIN/www/static/test.gif". > > Questions: > > (1) What am I missing? Should the test.gif file be somewhere else? > Should I try this with some other URL instead of the one I mention > above? It looks like you don't understand at least two basic things: 1. Location directive maps *URI* namespace to configuration. That is, with your config /test.gif will be mapped to "location /", i.e. will be proxy_pass'ed to Apache. You want to request something like /site/static/test.gif to be actually served by nginx itself. See here for more details: http://wiki.nginx.org/HttpCoreModule#location 2. Root directive define *root*, and URI will be added to it to map request to filesystem. I.e. with URI /site/static/test.gif and root /home/MYDOMAIN/www/static you will end up with "/home/MYDOMAIN/www/static/site/static/test.gif" filename. If you want "/site/static/test.gif" to be mapped to "/home/MYDOMAIN/www/static/test.gif" you have to use alias directive instead. See here for more details: http://wiki.nginx.org/HttpCoreModule#root http://wiki.nginx.org/HttpCoreModule#alias > (2) Also, if this worked, and I accepted Nginx to be at the front and > moved Apache to the background, isn't it true that Apache would have to > pass back all processed output to Nginx? Yes. And this is a huge win in many cases: Apache processes won't be bound by serving responses to slow clients. > (3) Even with "proxy_redirect off", when I try http://MYDOMAIN.com:81, > it actually does a hard 301 redirect to my Apache server. Directive proxy_redirect is to fix redirects returned by backend server. By switching it off you merely said "don't touch anything" to nginx, and this is what it does. I.e. redirect is returned by your Apache server (alternatively, it may be just your browser's cache from previous testing - check logs). Maxim Dounin From nginx-forum at nginx.us Sun May 29 09:11:09 2011 From: nginx-forum at nginx.us (pk899) Date: Sun, 29 May 2011 01:11:09 -0400 Subject: Newbie questions about nginx (moving from apache) In-Reply-To: <6f56cffc73aa96c01438b44bd1386150.NginxMailingListEnglish@forum.nginx.org> References: <6f56cffc73aa96c01438b44bd1386150.NginxMailingListEnglish@forum.nginx.org> Message-ID: <70a981027302704e080d171c450740c4.NginxMailingListEnglish@forum.nginx.org> thanks igor and maxim. the proxy stuff is not working for me but i am so liking the nginx server that i will follow your advice to not care about mod security so much and just do application level checking in php. my question: is there a simple guide to get php working on nginx when it is already installed and running with apache as mod_php on the server? while testing nginx i dont want to break already working functionality. there are online guides for "fastcgi" but they are all different and sometimes old syntax so they are confusing. is there a recommended official config file that will cover the best practice for a production server, including: 1. static files be served with "expires" or etags etc 2. php with all the modules installed on my server (memcache, etc) 3. secure php i want to now just try nginx running on server:81 port and see if it can do *everything* that apache does, if i move some of the functionality to my php application (such as checking RBLs etc). thanks so much. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,201449,201911#msg-201911 From nginx-forum at nginx.us Sun May 29 18:29:07 2011 From: nginx-forum at nginx.us (pk899) Date: Sun, 29 May 2011 10:29:07 -0400 Subject: Error message control when using nginx as proxy.. Message-ID: I have setup nginx as a front proxy, it passes php requests to Apache. When I now try to access my site through, say, "TRACE", then naturally I see the 405 error. But this is a nginx default message. How can I make sure that I see my own customized error page? I have this in my "Server" definition... #================================ # Custom error page... #================================ error_page 400 401 402 403 405 406 407 408 409 410 411 412 413 414 415 416 417 495 496 497 500 501 502 503 504 505 506 507 /error.htm; But this does not seem to be working. For the 405, it still shows the default nginx page. Anything I can do about this? Secondly, for Apache, there is still some mod_security stuff that sends back a "406". How can I make sure that Apache sending that signal back to Nginx only triggers the 406 I have setup in nginx? Thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,201978,201978#msg-201978 From nginx-forum at nginx.us Sun May 29 20:07:56 2011 From: nginx-forum at nginx.us (pk899) Date: Sun, 29 May 2011 12:07:56 -0400 Subject: Limit_conn with zones -- safe production server value? Message-ID: <81e2c45c150a8e0ac12ed3dd9f1b1503.NginxMailingListEnglish@forum.nginx.org> Hi. I am trying to replicate the functionality of mod_evasive on Apache, which basically says that at the same point the same IP can have only "X connections per second". I see the example here: http://wiki.nginx.org/HttpLimitZoneModule But this uses "binary_remote_addr". How does this cater for shared IPs, where people in the same network may actually have the same remote addr. Can I therefore use some other variable, such as a combination of "binary_remote_addr" and their "http_user_agent"? What is the most often used value in production environments? Thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,202012,202012#msg-202012 From jackdesert556 at gmail.com Mon May 30 01:03:19 2011 From: jackdesert556 at gmail.com (Jack Desert) Date: Sun, 29 May 2011 17:03:19 -0400 Subject: Getting All Documentation Under One Roof In-Reply-To: <4DE02376.4040503@gmail.com> References: <20110527153818.2d53fda3@dime> <1306532334.31643.6.camel@portable-evil> <4DE02376.4040503@gmail.com> Message-ID: <20110529170319.459f7d55@dime> On Sat, 28 May 2011 01:19:34 +0300 Eugaia wrote: > I agree that linking to the original docs would also be useful. That's a good idea. I put a link to http://nginx.org/en/docs/ on the http://wiki.nginx.org/Resources page I've also been looking at the organization of the main docs on nginx.org. It appears that there are a total of seven documents that comprise the "Official Documentation", they being: -How nginx processes a request -Server names -Configuring HTTPS servers -(How to) debugging log -(How to) converting rewrite rules -nginx/windows usage -(FAQ) sys_errlist message However, it is difficult to see all these articles from a single web page. I don't know who manages the site, and noone has asked my opinion, but I believe it would be more intuitive to find nginx documentation if http://nginx.org/en/docs/ were a table of contents, laid out like this: documentation introduction to nginx How nginx processes a request Server names How to Configuring HTTPS servers (Create a) debugging log converting rewrite rules security advisories nginx/windows usage FAQ This way one could see all the options from a single, hierarchal glance. Since "security advisories", "howto", and "introduction" are all contained within this documentation, their links could be removed from the main page like this: {languages} news about download documentation faq wiki links books support which would make the main page cleaner. Now that's a good start to making things easy to find. But I notice that if you look closely, there are additional documents floating around. For example, go to http://nginx.org/ru/ (The Russian "about" page), and the text under "Basic HTTP Features" (???????? ???????????????? HTTP-???????) contains not just plain text, but links to more documentation located at http://sysoev.ru/nginx/docs/. Upon reading some of these docs, it looks like they comprised the beginning of the (possibly original?) wiki. And since they've been put into the wiki and not into the official docs page, I wonder if perhaps the plan has been for the wiki to replace the master docs? What is the overall plan here for documentation? Which is meant to be the master docs, the wiki or ngingx.org/docs? I want to help the cause by getting all the documentation under one roof, easily accessible, and well-organized. Help me to understand how I can do this. Jack Desert From tomlove at gmail.com Mon May 30 02:44:40 2011 From: tomlove at gmail.com (Thomas Love) Date: Mon, 30 May 2011 00:44:40 +0200 Subject: Getting All Documentation Under One Roof In-Reply-To: <20110529170319.459f7d55@dime> References: <20110527153818.2d53fda3@dime> <1306532334.31643.6.camel@portable-evil> <4DE02376.4040503@gmail.com> <20110529170319.459f7d55@dime> Message-ID: On 29 May 2011 23:03, Jack Desert wrote: > On Sat, 28 May 2011 01:19:34 +0300 > Eugaia wrote: > > > I want to help the cause by getting all the documentation under one roof, > easily accessible, and well-organized. Help me to understand how I can do > this. > > Jack Desert > > I'd be in favour of copying the pages of http://nginx.org/en/docs/ into http://wiki.nginx.org/ along with links to security advisories, books, etc. It would need to be kept up-to-date, but this would be a start, unless Igor is keen to keep them separate. I suspect there may be a better way to organise the top-level wiki sections (Install, Modules, Add-ons etc.) e.g. I was surprised to find http://wiki.nginx.org/HttpCoreModule in Modules when I first visited (it's logical, but wasn't obvious). I also think "Install" on the top level can be reworked to incorporate "Getting started" and "Full example", modified to implement auth_basic as well since this can easily be done dangerously by first-timers. So I would love to see two navigation paths streamlined: the path first-time users take in downloading, setting up, configuring, and the path returning users take getting reference on core, or on modules. Would be happy to help implement, if this makes sense to anyone else. Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From Dalibor.Jotanovic at herold.at Mon May 30 11:02:14 2011 From: Dalibor.Jotanovic at herold.at (Dalibor Jotanovic) Date: Mon, 30 May 2011 09:02:14 +0200 Subject: Antw: Re: NGINX loadbalancing ORACLE forms backends? In-Reply-To: References: <4DDF9C640200005E0003480F@mx.herold.at> Message-ID: <4DE35D16.97C0.005E.0@herold.at> Hi, i'll take a look at it. Thanks for the hint. Cheers, DJ >>> J?r?me Loyet 5/27/2011 12:52 >>> Hi have a look on this module I've made: http://code.google.com/p/nginx-sticky-module/ I'm using it in different environments (PHP, tomcat, jboss, ...). It can feet your need. Moreover it's independant from the type of backend you're using. hope this help ++ Jerome 2011/5/27 Dalibor Jotanovic Hi, does anybody have a working setup with NGINX loadbalancing ORACLE FORMS backends? I'm interested in setting up an environment with JSESSION cookie based sticky sessions. Regards, DJ HEROLD Business Data GmbH Guntramsdorfer Stra?e 105 A-2340 M?dling FN 233171z Landesgericht Wiener Neustadt Besuchen Sie uns online und mobil auf www.herold.at! Weitere Informationen zu unseren Produkten finden Sie unter: http://mobile.herold.at http://daten.herold.at Werden Sie Fan von HEROLD auf Facebook! Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen: www.clearsense.at www.tupalo.com www.aboutmedia.at www.love.at www.reise-hero.at www.urlauburlaub.at Diese E-Mail kann vertrauliche und/oder rechtlich gesch?tzte Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. _______________________________________________ nginx mailing list nginx at nginx.org http://nginx.org/mailman/listinfo/nginx Click here to report this email as spam. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1993 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1096 bytes Desc: not available URL: From Dalibor.Jotanovic at herold.at Mon May 30 11:04:02 2011 From: Dalibor.Jotanovic at herold.at (Dalibor Jotanovic) Date: Mon, 30 May 2011 09:04:02 +0200 Subject: Antw: Re: NGINX loadbalancing ORACLE forms backends? In-Reply-To: References: <4DDF9C640200005E0003480F@mx.herold.at> Message-ID: <4DE35D820200005E000348CF@mx.herold.at> Hi, i am actually using this module at the moment, but the documentated config option "srun...." doesn't seem to work in the latest nginx version. Does the option work on your side? Don't you get any errors? Cheers, DJ >>> ??? 5/27/2011 1:20 >>> See also this module: http://code.google.com/p/nginx-upstream-jvm-route/ ( http://code.google.com/p/nginx-upstream-jvm-route/ )This module achieves session stickiness with the session cookie. If the session is not in the cookie or URL, the module will be a normal Round-Robin upstream module. 2011/5/27 Dalibor Jotanovic Hi, does anybody have a working setup with NGINX loadbalancing ORACLE FORMS backends? I'm interested in setting up an environment with JSESSION cookie based sticky sessions. Regards, DJ ( http://www.herold.at ) ( http://www.herold.at ) HEROLD Business Data GmbH Guntramsdorfer Stra?e 105 A-2340 M?dling FN 233171z Landesgericht Wiener Neustadt Besuchen Sie uns online und mobil auf www.herold.at! Weitere Informationen zu unseren Produkten finden Sie unter: http://mobile.herold.at http://daten.herold.at ( http://www.facebook.com/derherold )Werden Sie Fan von HEROLD auf Facebook! Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen: www.clearsense.at www.tupalo.com www.aboutmedia.at ( http://www.tupalo.com ) www.love.at ( http://www.tupalo.com ) www.reise-hero.at ( http://www.tupalo.com ) www.urlauburlaub.at ( http://www.tupalo.com ) ( http://www.tupalo.com ) Diese E-Mail kann vertrauliche und/oder rechtlich gesch?tzte Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. _______________________________________________ nginx mailing list nginx at nginx.org http://nginx.org/mailman/listinfo/nginx Click here ( https://www.mailcontrol.com/sr/t91yjfYfe5jTndxI!oX7Uh5Cv+dgaYj8ylv+aQFyzJM2yPGdnNdCJu57SCsCe4JD1GQ2ktvKI6YpdY6WjzZSeg== ) to report this email as spam. HEROLD Business Data GmbH Guntramsdorfer Stra?e 105 A-2340 M?dling FN 233171z Landesgericht Wiener Neustadt Besuchen Sie uns online und mobil www.herold.at! Weitere Informationen zu unseren Produkten finden Sie unter: http://mobile.herold.at http://daten.herold.at Werden Sie Fan von HEROLD auf Facebook! Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen: www.clearsense.at www.tupalo.com www.aboutmedia.at www.love.at www.reise-hero.at www.urlauburlaub.at Diese E-Mail kann vertrauliche und/oder rechtlich gesch?tzte Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1993 bytes Desc: CompuServe GIF graphic URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1096 bytes Desc: CompuServe GIF graphic URL: From davidkazuhiro at gmail.com Mon May 30 11:32:19 2011 From: davidkazuhiro at gmail.com (David Somers-Harris) Date: Mon, 30 May 2011 16:32:19 +0900 Subject: HttpImageFilterModule: Crop with nonzero origin Message-ID: I'd like to use nginx's Image Filter Moduleto dynamically generate DeepZoomimages. However, I don't see an x-position or y-position argument for the crop directive. Is it even possible for the Image Filter Module to crop quadrants other than the top left? David -------------- next part -------------- An HTML attachment was scrubbed... URL: From Dalibor.Jotanovic at herold.at Mon May 30 13:27:11 2011 From: Dalibor.Jotanovic at herold.at (Dalibor Jotanovic) Date: Mon, 30 May 2011 11:27:11 +0200 Subject: Antw: Re: NGINX loadbalancing ORACLE forms backends? In-Reply-To: <4DE35D820200005E000348CF@mx.herold.at> References: <4DDF9C640200005E0003480F@mx.herold.at> <4DE35D820200005E000348CF@mx.herold.at> Message-ID: <4DE37F0F.97C0.005E.0@herold.at> Hi again, iirc that jvm route plugin is not supported by nginx. Anyway if somebody is having the same issue i had with that plugin and the mentioned srun config option, here is the *possible* solution to it: Set the jvm_route $cookie JESSIONID; before the server and srun definitons. Otherwise the plugin is not loaded and the srun option is unknown i guess... Cheers, DJ >>> "Dalibor Jotanovic" 5/30/2011 9:04 >>> Hi, i am actually using this module at the moment, but the documentated config option "srun...." doesn't seem to work in the latest nginx version. Does the option work on your side? Don't you get any errors? Cheers, DJ >>> ??? 5/27/2011 1:20 >>> See also this module: http://code.google.com/p/nginx-upstream-jvm-route/ This module achieves session stickiness with the session cookie. If the session is not in the cookie or URL, the module will be a normal Round-Robin upstream module. 2011/5/27 Dalibor Jotanovic Hi, does anybody have a working setup with NGINX loadbalancing ORACLE FORMS backends? I'm interested in setting up an environment with JSESSION cookie based sticky sessions. Regards, DJ HEROLD Business Data GmbH Guntramsdorfer Stra?e 105 A-2340 M?dling FN 233171z Landesgericht Wiener Neustadt Besuchen Sie uns online und mobil auf www.herold.at! Weitere Informationen zu unseren Produkten finden Sie unter: http://mobile.herold.at http://daten.herold.at Werden Sie Fan von HEROLD auf Facebook! Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen: www.clearsense.at www.tupalo.com www.aboutmedia.at www.love.at www.reise-hero.at www.urlauburlaub.at Diese E-Mail kann vertrauliche und/oder rechtlich gesch?tzte Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. _______________________________________________ nginx mailing list nginx at nginx.org http://nginx.org/mailman/listinfo/nginx Click here to report this email as spam. HEROLD Business Data GmbH Guntramsdorfer Stra?e 105 A-2340 M?dling FN 233171z Landesgericht Wiener Neustadt Besuchen Sie uns online und mobil auf www.herold.at! Weitere Informationen zu unseren Produkten finden Sie unter: http://mobile.herold.at http://daten.herold.at Werden Sie Fan von HEROLD auf Facebook! Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen: www.clearsense.at www.tupalo.com www.aboutmedia.at www.love.at www.reise-hero.at www.urlauburlaub.at Diese E-Mail kann vertrauliche und/oder rechtlich gesch?tzte Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1993 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1096 bytes Desc: not available URL: From mdounin at mdounin.ru Mon May 30 13:50:04 2011 From: mdounin at mdounin.ru (Maxim Dounin) Date: Mon, 30 May 2011 13:50:04 +0400 Subject: HttpImageFilterModule: Crop with nonzero origin In-Reply-To: References: Message-ID: <20110530095003.GL42265@mdounin.ru> Hello! On Mon, May 30, 2011 at 04:32:19PM +0900, David Somers-Harris wrote: > I'd like to use nginx's Image Filter > Moduleto dynamically > generate > DeepZoomimages. > > However, I don't see an x-position or y-position argument for the crop > directive. Is it even possible for the Image Filter Module to crop quadrants > other than the top left? Just a side note: "crop" isn't really crop, it is something like "resize and crop if needed". And no, it doesn't allow to crop image to arbitrary selected region. Maxim Dounin From nginx-forum at nginx.us Mon May 30 17:40:09 2011 From: nginx-forum at nginx.us (atipico) Date: Mon, 30 May 2011 09:40:09 -0400 Subject: =?UTF-8?Q?Simple_URI_redirection_/_alias_in_Nginx=E2=80=A6?= Message-ID: <841ddad79482575f6eecec727b5e01de.NginxMailingListEnglish@forum.nginx.org> Please, how can I make this simple operation: I wish that every requests for uris like: http://example.com/adm or: http://example.com/adm Goes to the wordpress login page: wordpress/wp-login.php (The wordpress installation is inside the folder "wordpress"). I've tried: location /adm/ { alias wordpress/wp-login.php; } location /adm { alias wordpress/wp-login.php; } and: rewrite ^/adm$ wordpress/wp-login.php; But with no success... Just in case someone asks, this is my serve conf. file: server { server_name www.example.com; rewrite ^ http://example.com$request_uri? permanent; } server { server_name example.com; access_log /var/log/nginx/example.com.access; error_log /var/log/nginx/example.com.error; root /var/www/example.com; index index.htm index.php; location / {try_files $uri /wp$uri/ /wordpress/index.php$args;} location ~ .php$ { try_files $uri =404; #fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; } location = /favicon.ico {log_not_found off;access_log off;} location = /robots.txt {allow all;log_not_found off;access_log off;} location ~ /\. {deny all;access_log off;log_not_found off; } } Posted at Nginx Forum: http://forum.nginx.org/read.php?2,202235,202235#msg-202235 From igor at sysoev.ru Mon May 30 22:47:10 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Mon, 30 May 2011 22:47:10 +0400 Subject: =?UTF-8?Q?Re=3A_Simple_URI_redirection_/_alias_in_Nginx=E2=80=A6?= In-Reply-To: <841ddad79482575f6eecec727b5e01de.NginxMailingListEnglish@forum.nginx.org> References: <841ddad79482575f6eecec727b5e01de.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110530184709.GD87429@sysoev.ru> On Mon, May 30, 2011 at 09:40:09AM -0400, atipico wrote: > Please, how can I make this simple operation: > > I wish that every requests for uris like: > http://example.com/adm > or: > http://example.com/adm > Goes to the wordpress login page: > wordpress/wp-login.php > (The wordpress installation is inside the folder "wordpress"). > > I've tried: > > location /adm/ { alias wordpress/wp-login.php; } > location /adm { alias wordpress/wp-login.php; } > > and: > > rewrite ^/adm$ wordpress/wp-login.php; > > But with no success... > > Just in case someone asks, this is my serve conf. file: > > server { > server_name www.example.com; > rewrite ^ http://example.com$request_uri? permanent; > } > > server { > server_name example.com; > > access_log /var/log/nginx/example.com.access; > error_log /var/log/nginx/example.com.error; > > root /var/www/example.com; > > index index.htm index.php; > > location / {try_files $uri /wp$uri/ /wordpress/index.php$args;} > > location ~ .php$ { > try_files $uri =404; > #fastcgi_split_path_info ^(.+\.php)(/.+)$; > fastcgi_pass 127.0.0.1:9000; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; > include /etc/nginx/fastcgi_params; > } > > location = /favicon.ico {log_not_found off;access_log off;} > location = /robots.txt {allow all;log_not_found off;access_log off;} > location ~ /\. {deny all;access_log off;log_not_found off; } > } location = /adm/ { fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME /var/www/example.com/wordpress/wp-login.php include /etc/nginx/fastcgi_params; } location = /adm { fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME /var/www/example.com/wordpress/wp-login.php include /etc/nginx/fastcgi_params; } -- Igor Sysoev From fxn at hashref.com Mon May 30 23:33:45 2011 From: fxn at hashref.com (Xavier Noria) Date: Mon, 30 May 2011 21:33:45 +0200 Subject: mod_proxy, compression, and chunked responses Message-ID: I have an application server behind nginx that may output chunked responses, and would like to use compression for them as I do for ordinary responses. Is that possible with nginx? If it is, is it possible in a way that nginx compresses stuff on the fly and sends chunked (compressed) responses itself rather than buffering the original response and sending a non-chunked response itself? (That would defeat the purpose of the chunked responses.) From nginx-forum at nginx.us Tue May 31 02:56:39 2011 From: nginx-forum at nginx.us (pk899) Date: Mon, 30 May 2011 18:56:39 -0400 Subject: =?UTF-8?Q?Re=3A_Simple_URI_redirection_/_alias_in_Nginx=E2=80=A6?= In-Reply-To: <841ddad79482575f6eecec727b5e01de.NginxMailingListEnglish@forum.nginx.org> References: <841ddad79482575f6eecec727b5e01de.NginxMailingListEnglish@forum.nginx.org> Message-ID: <70b8525468895548826d5775ed0bf6f6.NginxMailingListEnglish@forum.nginx.org> I have a similar issue. Do we need separate location directives for each and every possible path, or can we do some "rewrite" inside location for the main / root folder? For example: location = / { # rewrite rules come here.. rewrite "^/adm$" "/wordpress/wp-login.php"; .... fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME /var/www/example.com/wordpress/wp-login.php include /etc/nginx/fastcgi_params; } To me this is cleaner, but want to make sure that this is not the less desirable way? Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,202235,202430#msg-202430 From nginx-forum at nginx.us Tue May 31 02:57:50 2011 From: nginx-forum at nginx.us (pk899) Date: Mon, 30 May 2011 18:57:50 -0400 Subject: =?UTF-8?Q?Re=3A_Simple_URI_redirection_/_alias_in_Nginx=E2=80=A6?= In-Reply-To: <70b8525468895548826d5775ed0bf6f6.NginxMailingListEnglish@forum.nginx.org> References: <841ddad79482575f6eecec727b5e01de.NginxMailingListEnglish@forum.nginx.org> <70b8525468895548826d5775ed0bf6f6.NginxMailingListEnglish@forum.nginx.org> Message-ID: I meant this: location / { Not "location = / {" of course. Thanks! ------------------------------------------------------- > I have a similar issue. > > Do we need separate location directives for each > and every possible path, or can we do some > "rewrite" inside location for the main / root > folder? For example: > > location = / { > > # rewrite rules come here.. > rewrite "^/adm$" "/wordpress/wp-login.php"; > .... > fastcgi_pass 127.0.0.1:9000; > fastcgi_param SCRIPT_FILENAME > /var/www/example.com/wordpress/wp-login.php > include /etc/nginx/fastcgi_params; > > } > > > > To me this is cleaner, but want to make sure that > this is not the less desirable way? > > Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,202235,202431#msg-202431 From nginx-forum at nginx.us Tue May 31 03:03:17 2011 From: nginx-forum at nginx.us (atipico) Date: Mon, 30 May 2011 19:03:17 -0400 Subject: =?UTF-8?Q?Re=3A_Simple_URI_redirection_/_alias_in_Nginx=E2=80=A6?= In-Reply-To: <20110530184709.GD87429@sysoev.ru> References: <20110530184709.GD87429@sysoev.ru> Message-ID: <6dbb1ac66c6cdbf93869ec96357ad27a.NginxMailingListEnglish@forum.nginx.org> Thank you Igor. So what is the difference among doing what you told and this? rewrite ^/adm$ /wp/wp-login.php; Isn't it the case of usind the "alias"? Thank you onc more, Rogerio. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,202235,202432#msg-202432 From nginx-forum at nginx.us Tue May 31 04:07:03 2011 From: nginx-forum at nginx.us (pk899) Date: Mon, 30 May 2011 20:07:03 -0400 Subject: Formatting of nginx.conf -- any impact on performance? Message-ID: <784b5294f522fb504e063c13c08fc9d7.NginxMailingListEnglish@forum.nginx.org> Hi. Probably a silly question, but I have noticed that if I have a properly tabbed/spaced config file, the performance of nginx goes down. Is this a valid observation? Thanks. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,202451,202451#msg-202451 From gvimrc at gmail.com Tue May 31 05:14:04 2011 From: gvimrc at gmail.com (gvim) Date: Tue, 31 May 2011 02:14:04 +0100 Subject: Multiple server_name entries not working Message-ID: <4DE440DC.9040605@gmail.com> Nginx 1.0.3 I have a virtual host file with a simple config: server { listen 8080; server_name domain.com www.domain.com; root /var/www/html/dm2011/pub; access_log /var/log/nginx/access.log main; location / { index index.htm index.html; } } Requests for 'domain.com' return the correct index page but requests for 'www.domain.com' return only the "Welcome to nginx!" page. I tried *.domain.com also as the 2nd name but the result was the same. There are no DNS issues with both versions of the domain. gvim From igor at sysoev.ru Tue May 31 06:07:02 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 31 May 2011 06:07:02 +0400 Subject: Multiple server_name entries not working In-Reply-To: <4DE440DC.9040605@gmail.com> References: <4DE440DC.9040605@gmail.com> Message-ID: <20110531020702.GA5992@sysoev.ru> On Tue, May 31, 2011 at 02:14:04AM +0100, gvim wrote: > Nginx 1.0.3 > > I have a virtual host file with a simple config: > > server { > listen 8080; > server_name domain.com www.domain.com; > root /var/www/html/dm2011/pub; > access_log /var/log/nginx/access.log main; > > location / { > index index.htm index.html; > } > } > > Requests for 'domain.com' return the correct index page but requests for 'www.domain.com' return only the "Welcome to nginx!" page. I tried *.domain.com also as the 2nd name but the result was the same. There are no DNS issues with both versions of the domain. If you set server_name domain.com www.domain.com; what does "nginx -t" show ? -- Igor Sysoev From igor at sysoev.ru Tue May 31 06:07:17 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 31 May 2011 06:07:17 +0400 Subject: Formatting of nginx.conf -- any impact on performance? In-Reply-To: <784b5294f522fb504e063c13c08fc9d7.NginxMailingListEnglish@forum.nginx.org> References: <784b5294f522fb504e063c13c08fc9d7.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110531020717.GB5992@sysoev.ru> On Mon, May 30, 2011 at 08:07:03PM -0400, pk899 wrote: > Hi. Probably a silly question, but I have noticed that if I have a > properly tabbed/spaced config file, the performance of nginx goes down. > Is this a valid observation? No. -- Igor Sysoev From igor at sysoev.ru Tue May 31 06:11:06 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 31 May 2011 06:11:06 +0400 Subject: =?UTF-8?Q?Re=3A_Simple_URI_redirection_/_alias_in_Nginx=E2=80=A6?= In-Reply-To: <6dbb1ac66c6cdbf93869ec96357ad27a.NginxMailingListEnglish@forum.nginx.org> References: <20110530184709.GD87429@sysoev.ru> <6dbb1ac66c6cdbf93869ec96357ad27a.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110531021105.GC5992@sysoev.ru> On Mon, May 30, 2011 at 07:03:17PM -0400, atipico wrote: > Thank you Igor. > > So what is the difference among doing what you told and this? > rewrite ^/adm$ /wp/wp-login.php; Configuration maintenance. If you will not use rewrites and regex locations, then you can easy change large configuration. > Isn't it the case of usind the "alias"? "alias" is for static files, but not scripts. -- Igor Sysoev From gvimrc at gmail.com Tue May 31 06:34:19 2011 From: gvimrc at gmail.com (gvim) Date: Tue, 31 May 2011 03:34:19 +0100 Subject: Multiple server_name entries not working In-Reply-To: <20110531020702.GA5992@sysoev.ru> References: <4DE440DC.9040605@gmail.com> <20110531020702.GA5992@sysoev.ru> Message-ID: <4DE453AB.3090303@gmail.com> On 31/05/2011 03:07, Igor Sysoev wrote: > If you set server_name domain.com www.domain.com; what does "nginx > -t" show ? > It gave a syntax OK response. It's mysteriously fixed now after retyping the line. Maybe my eyesight is going. gvim From david at somers-harris.com Tue May 31 11:21:57 2011 From: david at somers-harris.com (David Somers Harris) Date: Tue, 31 May 2011 16:21:57 +0900 Subject: HttpImageFilterModule: Crop with nonzero origin In-Reply-To: <20110530095003.GL42265@mdounin.ru> References: <20110530095003.GL42265@mdounin.ru> Message-ID: Ah I see. Too bad. When the Image Filter Module crops, does it crop out the right and bottom ends only, or does it evenly crop the top, left, right and bottom out? David -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor at sysoev.ru Tue May 31 11:40:19 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 31 May 2011 11:40:19 +0400 Subject: HttpImageFilterModule: Crop with nonzero origin In-Reply-To: References: <20110530095003.GL42265@mdounin.ru> Message-ID: <20110531074019.GA21552@sysoev.ru> On Tue, May 31, 2011 at 04:21:57PM +0900, David Somers Harris wrote: > Ah I see. Too bad. > > When the Image Filter Module crops, does it crop out the right and bottom > ends only, or does it evenly crop the top, left, right and bottom out? It tries to keep as much as possible of an original image: The image is scaled on one dimension and then is croped on other dimension. -- Igor Sysoev From nbubingo at gmail.com Tue May 31 11:58:53 2011 From: nbubingo at gmail.com (=?GB2312?B?0qbOsLHz?=) Date: Tue, 31 May 2011 15:58:53 +0800 Subject: NGINX loadbalancing ORACLE forms backends? In-Reply-To: <4DE37F0F.97C0.005E.0@herold.at> References: <4DDF9C640200005E0003480F@mx.herold.at> <4DE35D820200005E000348CF@mx.herold.at> <4DE37F0F.97C0.005E.0@herold.at> Message-ID: Hi Dalibor, This may be a configure sequence problem. Do you put the upstream block behind the server block? The upstream block should be put before the server block. If you try other options, like "weight=10", there will be problem too. 2011/5/30 Dalibor Jotanovic > Hi again, > > iirc that jvm route plugin is not supported by nginx. Anyway if somebody is > having the same issue i had with that plugin and the mentioned srun config > option, here is the *possible* solution to it: > > Set the *jvm_route $cookie JESSIONID;* *before *the server and srun > definitons. Otherwise the plugin is not loaded and the srun option is > unknown i guess... > > Cheers, > DJ > > > >>> "Dalibor Jotanovic" 5/30/2011 9:04 >>> > Hi, > > i am actually using this module at the moment, but the documentated > config option "srun...." doesn't seem to work in the latest nginx version. > Does the option work on your side? Don't you get any errors? > > Cheers, > DJ > > >>> ??? 5/27/2011 1:20 >>> > See also this module: http://code.google.com/p/nginx-upstream-jvm-route/ > > This module achieves > session stickiness with the session cookie. If the session is not in the > cookie or URL, the module will be a normal Round-Robin upstream module. > > 2011/5/27 Dalibor Jotanovic > >> Hi, >> does anybody have a working setup with NGINX loadbalancing ORACLE FORMS >> backends? >> I'm interested in setting up an environment with JSESSION cookie based >> sticky sessions. >> Regards, >> DJ >> >> >> >> >> HEROLD Business Data GmbH >> Guntramsdorfer Stra?e 105 >> A-2340 M?dling >> >> FN 233171z >> Landesgericht Wiener Neustadt >> >> Besuchen Sie uns online und mobil auf *www.herold.at* >> ! >> >> Weitere Informationen zu unseren Produkten finden Sie unter: >> *http://mobile.herold.at* >> *http://daten.herold.at * >> >> Werden Sie Fan von HEROLD auf >> Facebook! >> >> >> Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen: >> *www.clearsense.at * >> *www.tupalo.com * >> *www.aboutmedia.at* * * >> *www.love.at* * * >> *www.reise-hero.at* * * >> *www.urlauburlaub.at* * >> * >> >> Diese E-Mail kann vertrauliche und/oder rechtlich gesch?tzte Informationen >> enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail >> irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und >> vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte >> Weitergabe dieser Mail sind nicht gestattet. >> >> This e-mail may contain confidential and/or privileged information. If you >> are not the intended recipient (or have received this e-mail in error) >> please notify the sender immediately and delete this e-mail. Any >> unauthorized copying, disclosure or distribution of the material in this >> e-mail is strictly forbidden. >> >> _______________________________________________ >> nginx mailing list >> nginx at nginx.org >> http://nginx.org/mailman/listinfo/nginx >> >> > > > Click hereto report this email as spam. > > > > > HEROLD Business Data GmbH > Guntramsdorfer Stra?e 105 > A-2340 M?dling > > FN 233171z > Landesgericht Wiener Neustadt > > Besuchen Sie uns online und mobil auf *www.herold.at* > ! > > Weitere Informationen zu unseren Produkten finden Sie unter: > *http://mobile.herold.at* > *http://daten.herold.at * > > Werden Sie Fan von HEROLD auf Facebook! > > > Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen: > *www.clearsense.at * > *www.tupalo.com * > *www.aboutmedia.at* * * > *www.love.at* * * > *www.reise-hero.at* * * > *www.urlauburlaub.at* * > * > > Diese E-Mail kann vertrauliche und/oder rechtlich gesch?tzte Informationen > enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail > irrt?mlich erhalten haben, informieren Sie bitte sofort den Absender und > vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte > Weitergabe dieser Mail sind nicht gestattet. > > This e-mail may contain confidential and/or privileged information. If you > are not the intended recipient (or have received this e-mail in error) > please notify the sender immediately and delete this e-mail. Any > unauthorized copying, disclosure or distribution of the material in this > e-mail is strictly forbidden. > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Tue May 31 15:20:34 2011 From: nginx-forum at nginx.us (csg) Date: Tue, 31 May 2011 07:20:34 -0400 Subject: Accessing binary blob data in MySQL backend Message-ID: <547a0936722abfbca78f1b68df1588dd.NginxMailingListEnglish@forum.nginx.org> Hi! I am curious if is feasible to have Nginx deliver binary blob data which is currently stored in a MySQL database. I was loosely following the examples mentioned in agentzh's blog [1] which work all fine for me with non-binary data. But as JSON is used for intermediate serialization which is not binary safe I was wondering if there are other ways (or even modules) that access the raw payload data from its RDS representation. In my scenario I'm trying to access images data like JPEGs stored as blobs in MySQL causing the JSON parser to fail of course content_by_lua aborted: runtime error: InvalidJSONInput: lexical error: invalid bytes in UTF8 string. My current software stack consists of CentOS 5.6/x86_64, Nignx 1.0.3 (plus simpl-ngx_devel_kit 0.2.17, chaoslawful-lua-nginx-module 0.1.5, chaoslawful-drizzle-nginx-module 0.0.14, agentzh-rds-json-nginx-module 0.10), Lua 5.1.4, LuaRocks 2.0.4.1, Lua YAJL 2.0, YAJL 2.0.1, Drizzle7 libraries 2011.04.15 and MySQL database 5.1.57. [1] http://agentzh.blogspot.com/2011/02/ngxlua-v015-ability-to-capture-multiple_6605.html Posted at Nginx Forum: http://forum.nginx.org/read.php?2,202577,202577#msg-202577 From nginx-forum at nginx.us Tue May 31 15:50:52 2011 From: nginx-forum at nginx.us (Ensiferous) Date: Tue, 31 May 2011 07:50:52 -0400 Subject: Multiple server_name entries not working In-Reply-To: <4DE440DC.9040605@gmail.com> References: <4DE440DC.9040605@gmail.com> Message-ID: Sounds like it was a browser caching issue. Browsers cache aggressively so always test with curl when you're making changes. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,202461,202582#msg-202582 From mp3geek at gmail.com Tue May 31 17:04:34 2011 From: mp3geek at gmail.com (Ryan B) Date: Wed, 1 Jun 2011 01:04:34 +1200 Subject: Tweaking nginx workers nice values Message-ID: Is it possible to set the nice values for nginx worker processes, the main processs can be tweaked easily.. but I'd like to tweak the worker processes too.. Thanks. From mp3geek at gmail.com Tue May 31 17:27:07 2011 From: mp3geek at gmail.com (Ryan B) Date: Wed, 1 Jun 2011 01:27:07 +1200 Subject: Tweaking nginx workers nice values In-Reply-To: References: Message-ID: ah, discovered worker_priority variable :) On Wed, Jun 1, 2011 at 1:04 AM, Ryan B wrote: > Is it possible to set the nice values for nginx worker processes, the > main processs can be tweaked easily.. but I'd like to tweak the worker > processes too.. > > Thanks. > From igor at sysoev.ru Tue May 31 17:57:35 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 31 May 2011 17:57:35 +0400 Subject: Accessing binary blob data in MySQL backend In-Reply-To: <547a0936722abfbca78f1b68df1588dd.NginxMailingListEnglish@forum.nginx.org> References: <547a0936722abfbca78f1b68df1588dd.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110531135734.GA56723@sysoev.ru> On Tue, May 31, 2011 at 07:20:34AM -0400, csg wrote: > Hi! > > I am curious if is feasible to have Nginx deliver binary blob data which > is currently stored in a MySQL database. I was loosely following the > examples mentioned in agentzh's blog [1] which work all fine for me with > non-binary data. But as JSON is used for intermediate serialization > which is not binary safe I was wondering if there are other ways (or > even modules) that access the raw payload data from its RDS > representation. > > In my scenario I'm trying to access images data like JPEGs stored as > blobs in MySQL causing the JSON parser to fail of course I can not say anuthing about subject, I'm just interesting are any advanatges to store images in MySQL instead of file system ? -- Igor Sysoev From mat999 at gmail.com Tue May 31 18:06:12 2011 From: mat999 at gmail.com (SplitIce) Date: Wed, 1 Jun 2011 00:06:12 +1000 Subject: Accessing binary blob data in MySQL backend In-Reply-To: <20110531135734.GA56723@sysoev.ru> References: <547a0936722abfbca78f1b68df1588dd.NginxMailingListEnglish@forum.nginx.org> <20110531135734.GA56723@sysoev.ru> Message-ID: ease of management is the main positive, I recently moved away from it myself to a filesystem based solution for one of my clients. The largest disadvantage is the size of the table. Oh and JSON can be binary safe if implmented correctly with correct escape sequences, yes? On Tue, May 31, 2011 at 11:57 PM, Igor Sysoev wrote: > On Tue, May 31, 2011 at 07:20:34AM -0400, csg wrote: > > Hi! > > > > I am curious if is feasible to have Nginx deliver binary blob data which > > is currently stored in a MySQL database. I was loosely following the > > examples mentioned in agentzh's blog [1] which work all fine for me with > > non-binary data. But as JSON is used for intermediate serialization > > which is not binary safe I was wondering if there are other ways (or > > even modules) that access the raw payload data from its RDS > > representation. > > > > In my scenario I'm trying to access images data like JPEGs stored as > > blobs in MySQL causing the JSON parser to fail of course > > I can not say anuthing about subject, I'm just interesting are any > advanatges to store images in MySQL instead of file system ? > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -- Warez Scene Free Rapidshare Downloads -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor at sysoev.ru Tue May 31 18:25:44 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 31 May 2011 18:25:44 +0400 Subject: Tweaking nginx workers nice values In-Reply-To: References: Message-ID: <20110531142544.GB56723@sysoev.ru> On Wed, Jun 01, 2011 at 01:04:34AM +1200, Ryan B wrote: > Is it possible to set the nice values for nginx worker processes, the > main processs can be tweaked easily.. but I'd like to tweak the worker > processes too.. worker_priority -10; -- Igor Sysoev From igor at sysoev.ru Tue May 31 18:27:29 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 31 May 2011 18:27:29 +0400 Subject: Tweaking nginx workers nice values In-Reply-To: References: Message-ID: <20110531142729.GC56723@sysoev.ru> On Wed, Jun 01, 2011 at 01:27:07AM +1200, Ryan B wrote: > ah, discovered worker_priority variable :) This is not variable. This is a directive. -- Igor Sysoev From igor at sysoev.ru Tue May 31 18:33:18 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 31 May 2011 18:33:18 +0400 Subject: Accessing binary blob data in MySQL backend In-Reply-To: References: <547a0936722abfbca78f1b68df1588dd.NginxMailingListEnglish@forum.nginx.org> <20110531135734.GA56723@sysoev.ru> Message-ID: <20110531143318.GD56723@sysoev.ru> On Wed, Jun 01, 2011 at 12:06:12AM +1000, SplitIce wrote: > ease of management is the main positive, I recently moved away from it What do you mean by "ease of management". As for me there is no easier management than file system one. You have a lot of tools - find, grep, etc. > myself to a filesystem based solution for one of my clients. The largest > disadvantage is the size of the table. Oh and JSON can be binary safe if > implmented correctly with correct escape sequences, yes? > > On Tue, May 31, 2011 at 11:57 PM, Igor Sysoev wrote: > > > On Tue, May 31, 2011 at 07:20:34AM -0400, csg wrote: > > > Hi! > > > > > > I am curious if is feasible to have Nginx deliver binary blob data which > > > is currently stored in a MySQL database. I was loosely following the > > > examples mentioned in agentzh's blog [1] which work all fine for me with > > > non-binary data. But as JSON is used for intermediate serialization > > > which is not binary safe I was wondering if there are other ways (or > > > even modules) that access the raw payload data from its RDS > > > representation. > > > > > > In my scenario I'm trying to access images data like JPEGs stored as > > > blobs in MySQL causing the JSON parser to fail of course > > > > I can not say anuthing about subject, I'm just interesting are any > > advanatges to store images in MySQL instead of file system ? -- Igor Sysoev From mat999 at gmail.com Tue May 31 18:38:33 2011 From: mat999 at gmail.com (SplitIce) Date: Wed, 1 Jun 2011 00:38:33 +1000 Subject: Accessing binary blob data in MySQL backend In-Reply-To: <20110531143318.GD56723@sysoev.ru> References: <547a0936722abfbca78f1b68df1588dd.NginxMailingListEnglish@forum.nginx.org> <20110531135734.GA56723@sysoev.ru> <20110531143318.GD56723@sysoev.ru> Message-ID: DELETE FROM images WHERE (uploaded_user='user1' OR uploaded_user='user2') AND uploaded_date > 123 AND gallery_id=0 SQL makes querying and management easy, thats why some people choose to store their data in mysql BLOBs instead of on the filesystem. On Wed, Jun 1, 2011 at 12:33 AM, Igor Sysoev wrote: > On Wed, Jun 01, 2011 at 12:06:12AM +1000, SplitIce wrote: > > ease of management is the main positive, I recently moved away from it > > What do you mean by "ease of management". As for me there is no easier > management than file system one. You have a lot of tools - find, grep, > etc. > > > myself to a filesystem based solution for one of my clients. The largest > > disadvantage is the size of the table. Oh and JSON can be binary safe if > > implmented correctly with correct escape sequences, yes? > > > > On Tue, May 31, 2011 at 11:57 PM, Igor Sysoev wrote: > > > > > On Tue, May 31, 2011 at 07:20:34AM -0400, csg wrote: > > > > Hi! > > > > > > > > I am curious if is feasible to have Nginx deliver binary blob data > which > > > > is currently stored in a MySQL database. I was loosely following the > > > > examples mentioned in agentzh's blog [1] which work all fine for me > with > > > > non-binary data. But as JSON is used for intermediate serialization > > > > which is not binary safe I was wondering if there are other ways (or > > > > even modules) that access the raw payload data from its RDS > > > > representation. > > > > > > > > In my scenario I'm trying to access images data like JPEGs stored as > > > > blobs in MySQL causing the JSON parser to fail of course > > > > > > I can not say anuthing about subject, I'm just interesting are any > > > advanatges to store images in MySQL instead of file system ? > > > -- > Igor Sysoev > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > -- Warez Scene Free Rapidshare Downloads -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx-forum at nginx.us Tue May 31 18:42:31 2011 From: nginx-forum at nginx.us (csg) Date: Tue, 31 May 2011 10:42:31 -0400 Subject: Accessing binary blob data in MySQL backend In-Reply-To: <20110531135734.GA56723@sysoev.ru> References: <20110531135734.GA56723@sysoev.ru> Message-ID: Igor Sysoev Wrote: ------------------------------------------------------- > I can not say anuthing about subject, I'm just > interesting are any > advanatges to store images in MySQL instead of > file system ? First of all quite a lot of backend processes and application code relies on it. Those interfaces cannot be changed easily. But on the other hand for the ease of handling the data. For redundancy it is much easier and more performant to do MySQL replication instead of file system based approaches. With millions of files even when using deep hashed subdirectory trees a full rsync(1) run would take several hours up to half a day to perform a sync. Even when using tools utilizing the inotify(7) framework like lsyncd(1) [1] you have to run a full rsync(1) run from time (e.g., reboots due to kernel updates, inotify event overflow, etc.). With data backup you would face the same issues, too. As company policies discourage the use of AGPL-licenses software, MongoDB/gridfs is also not an option. Our current solution is Apache 2.2 MPM worker/Perl-based but on the long term this does not scale too well anymore, that's why we are looking for alternatives. [1] http://code.google.com/p/lsyncd/ Posted at Nginx Forum: http://forum.nginx.org/read.php?2,202577,202648#msg-202648 From nginx-forum at nginx.us Tue May 31 18:48:50 2011 From: nginx-forum at nginx.us (csg) Date: Tue, 31 May 2011 10:48:50 -0400 Subject: Accessing binary blob data in MySQL backend In-Reply-To: References: Message-ID: <016b6e4deb2ac124dbecc7857523eaed.NginxMailingListEnglish@forum.nginx.org> SplitIce Wrote: ------------------------------------------------------- > The largest > disadvantage is the size of the table. This can be easily avoided by sharding the data into many tables, accessing it per modulo operation on the numerical key. > Oh and JSON > can be binary safe if > implmented correctly with correct escape > sequences, yes? But this would require -- if I am not mistaken -- to touch all data end encode it with Base64 (or similar) which gives you computation and data capacity overhead. Additionally this would require changes to application which we are trying to avoid. Some component inbetwen like MySQL Proxy might be able to workaround this, but this increases latency which is also not desired. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,202577,202651#msg-202651 From anil at saog.net Tue May 31 18:52:02 2011 From: anil at saog.net (=?UTF-8?B?QW7EsWwgw4dldGlu?=) Date: Tue, 31 May 2011 17:52:02 +0300 Subject: Accessing binary blob data in MySQL backend In-Reply-To: References: <20110531135734.GA56723@sysoev.ru> Message-ID: <4DE50092.9060400@saog.net> You may try "fuse" (http://fuse.sourceforge.net/), implement a tiny file system easily which uses mysql as data source and acts as a real file system. On 5/31/2011 5:42 PM, csg wrote: > Igor Sysoev Wrote: > ------------------------------------------------------- > >> I can not say anuthing about subject, I'm just >> interesting are any >> advanatges to store images in MySQL instead of >> file system ? > First of all quite a lot of backend processes and application code > relies on it. Those interfaces cannot be changed easily. But on the > other hand for the ease of handling the data. For redundancy it is much > easier and more performant to do MySQL replication instead of file > system based approaches. With millions of files even when using deep > hashed subdirectory trees a full rsync(1) run would take several hours > up to half a day to perform a sync. Even when using tools utilizing the > inotify(7) framework like lsyncd(1) [1] you have to run a full rsync(1) > run from time (e.g., reboots due to kernel updates, inotify event > overflow, etc.). With data backup you would face the same issues, too. > As company policies discourage the use of AGPL-licenses software, > MongoDB/gridfs is also not an option. Our current solution is Apache 2.2 > MPM worker/Perl-based but on the long term this does not scale too well > anymore, that's why we are looking for alternatives. > > [1] http://code.google.com/p/lsyncd/ > > Posted at Nginx Forum: http://forum.nginx.org/read.php?2,202577,202648#msg-202648 > > > _______________________________________________ > nginx mailing list > nginx at nginx.org > http://nginx.org/mailman/listinfo/nginx > From nginx-forum at nginx.us Tue May 31 19:05:09 2011 From: nginx-forum at nginx.us (csg) Date: Tue, 31 May 2011 11:05:09 -0400 Subject: Accessing binary blob data in MySQL backend In-Reply-To: <4DE50092.9060400@saog.net> References: <4DE50092.9060400@saog.net> Message-ID: <004b4559b17a8f3403da518681738b0b.NginxMailingListEnglish@forum.nginx.org> mow Wrote: ------------------------------------------------------- > You may try "fuse" (http://fuse.sourceforge.net/), > implement a tiny file > system easily which uses mysql as data source and > acts as a real file > system. Correct me if I am wrong, but I reckon that context switches between kernel and a userland filesystem would be detrimental to the performance.Performance is the key ;-) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,202577,202655#msg-202655 From igor at sysoev.ru Tue May 31 19:08:03 2011 From: igor at sysoev.ru (Igor Sysoev) Date: Tue, 31 May 2011 19:08:03 +0400 Subject: Accessing binary blob data in MySQL backend In-Reply-To: <004b4559b17a8f3403da518681738b0b.NginxMailingListEnglish@forum.nginx.org> References: <4DE50092.9060400@saog.net> <004b4559b17a8f3403da518681738b0b.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20110531150803.GF56723@sysoev.ru> On Tue, May 31, 2011 at 11:05:09AM -0400, csg wrote: > mow Wrote: > ------------------------------------------------------- > > You may try "fuse" (http://fuse.sourceforge.net/), > > implement a tiny file > > system easily which uses mysql as data source and > > acts as a real file > > system. > > Correct me if I am wrong, but I reckon that context switches between > kernel and a userland filesystem would be detrimental to the > performance.Performance is the key ;-) If perfomance is the key, you should use a file system. Or you believe that reading from MySQL is magic zero transportation ? :) -- Igor Sysoev From nginx-forum at nginx.us Tue May 31 19:24:41 2011 From: nginx-forum at nginx.us (csg) Date: Tue, 31 May 2011 11:24:41 -0400 Subject: Accessing binary blob data in MySQL backend In-Reply-To: <20110531150803.GF56723@sysoev.ru> References: <20110531150803.GF56723@sysoev.ru> Message-ID: <4cdcc593ca373de3f2c5398ee3f4b03d.NginxMailingListEnglish@forum.nginx.org> Igor Sysoev Wrote: ------------------------------------------------------- > If perfomance is the key, you should use a file > system. > Or you believe that reading from MySQL is magic > zero transportation ? :) For sure not, and I didn't say so. But instead of bringing yet another software component into play and entering a semi-flameware about the pros and cons to store blobs in databases (there are already so many on the net, and I am looking for information I couldn't find on the net) I had rather hoped to get some backgr