2010年5月31日星期一

Re: nginx-0.8.38

Nailed down the root issue, it was a bad openssl installation.
--
Posted via http://www.ruby-forum.com/.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Packages for Ubuntu 10.04 LTS... Re: nginx-0.8.39

Well I narrowed the source of the issue, it was a bad openssl
installation.
--
Posted via http://www.ruby-forum.com/.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Packages for Ubuntu 10.04 LTS... Re: nginx-0.8.39

Nginx 0.8.39 seems to segfault on run, just the same as 0.8.38; 0.8.37
works fine.

truss output; http://victori.uploadbooth.com/pastes/fwqqcvtHP
core dump; http://victori.uploadbooth.com/work/nginx-coredump.tbz2

OS: OpenSolaris SNV98 / SunCC

backtrace via dbx

# dbx objs/nginx
For information about new features see `help changes'
To remove this message, put `dbxenv suppress_startup_message 7.7' in
your .dbxrc
Reading nginx
Reading ld.so.1
Reading libsocket.so.1
Reading libnsl.so.1
Reading libsendfile.so.1
Reading libz.so.1.2.4
Reading libc.so.1
Reading libgcc_s.so.1
(dbx) run
Running: nginx
(process id 9779)
signal SEGV (no mapping at the fault address) in _init at 0x81ef625
0x081ef625: _init+0x0015: addb %al,(%eax)
(dbx) bt
bt: not found
(dbx) where
=>[1] _init(0x1, 0x8047c7c, 0x8047c84, 0x0, 0x0, 0x1), at 0x81ef625
(dbx)

What I use to compile:

CC=/opt/SunStudioExpress/bin/cc ./configure --with-pcre=../pcre-7.6
--prefix=/opt/extra/nginx --with-http_stub_status_module
--with-http_flv_module --with-http_ssl_module
--add-module=../nginx_uploadprogress_module --with-http_dav_module
--add-module=../mod_strip --with-perl=/opt/extra/bin/perl
--with-http_gzip_static_module --with-http_realip_module
--
Posted via http://www.ruby-forum.com/.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: nginx-0.8.38

Err yet again I spoke too soon, here is a core dump.

http://victori.uploadbooth.com/work/nginx-coredump.tbz2
--
Posted via http://www.ruby-forum.com/.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: nginx-0.8.38

Upon further research this is all I can give you;

# dbx objs/nginx
For information about new features see `help changes'
To remove this message, put `dbxenv suppress_startup_message 7.7' in
your .dbxrc
Reading nginx
Reading ld.so.1
Reading libsocket.so.1
Reading libnsl.so.1
Reading libsendfile.so.1
Reading libz.so.1.2.4
Reading libc.so.1
Reading libgcc_s.so.1
(dbx) run
Running: nginx
(process id 9779)
signal SEGV (no mapping at the fault address) in _init at 0x81ef625
0x081ef625: _init+0x0015: addb %al,(%eax)
(dbx) bt
bt: not found
(dbx) where
=>[1] _init(0x1, 0x8047c7c, 0x8047c84, 0x0, 0x0, 0x1), at 0x81ef625
(dbx)

What I use to compile:

CC=/opt/SunStudioExpress/bin/cc ./configure --with-pcre=../pcre-7.6
--prefix=/opt/extra/nginx --with-http_stub_status_module
--with-http_flv_module --with-http_ssl_module
--add-module=../nginx_uploadprogress_module --with-http_dav_module
--add-module=../mod_strip --with-perl=/opt/extra/bin/perl
--with-http_gzip_static_module --with-http_realip_module
--
Posted via http://www.ruby-forum.com/.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: nginx-0.8.38

I would but it segfaults, and no gdb on this system ;-(
--
Posted via http://www.ruby-forum.com/.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: upstream using header value

The module is very easy to install and use. I just tested it. As far as mainlining into nginx, I would think that a generic module which can offer session stickyness for _any_ configurable cookie/query would certainly be worth including into the nginx main package. ** But that's not my call.


** In fact, I'm working on one now, I'll let you know how it goes :)

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,92528,92950#msg-92950


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Dynamic Upstream Provider List

The list will be very dynamic, as in new, previous unknown items should be able to be added at runtime. I'll thank you both for your suggestions and will investigate them. Supervisord looks neat for a number of reasons outside of the scope of this :)

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,92715,92949#msg-92949


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: error directive help with 404

Hi,
thanks for responding.
i tried that but then i get "no input file specified"
I'm using php-fpm not fastcgi if that makes a difference...

thanks

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,91680,92852#msg-92852


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Load Balancing PHP

well it looks like you're using a public IP, which means it's over the
WAN, which you should make sure is firewalled (iptables or something)
so only the webserver(s) can connect, and depending on the latency
between the machines it might be so slow that it doesn't make sense.

On Mon, May 31, 2010 at 2:00 PM, Mickie D <nginx-forum@nginx.us> wrote:
> Yeah thanks mike that worked.
>
> The slave server is very slow :(
>
> Dunno why its going so slow but thanks for all your help
>
> Mick
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,92738,92830#msg-92830
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Load Balancing PHP

Yeah thanks mike that worked.

The slave server is very slow :(

Dunno why its going so slow but thanks for all your help

Mick

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,92738,92830#msg-92830


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Load Balancing PHP

the SCRIPT_FILENAME being passed is from the nginx machine to the PHP
fastcgi engines

PHP is taking that and saying "okay, i need to execute this pathname as PHP"

so yes, if it's not the same, you'll have issues. :p

there's probably some other creative ways to mangle it per machine but
for sanity you should keep things in sync anyway. a simple stack is a
happy stack.

On Mon, May 31, 2010 at 1:17 PM, Mickie D <nginx-forum@nginx.us> wrote:
> Must they be identical on both machines ?
>
> Because I have it running, if I go to the IP address.
> IE
> http://newserverip
>
> Then I can view the forums.
>
> So should I make the home directories exactly the same on both machines ?
>
> Regards
> Mick
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,92738,92809#msg-92809
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Load Balancing PHP

Must they be identical on both machines ?

Because I have it running, if I go to the IP address.
IE
http://newserverip

Then I can view the forums.

So should I make the home directories exactly the same on both machines ?

Regards
Mick

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,92738,92809#msg-92809


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Load Balancing PHP

i know that typically the error is due to this not being defined right:
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

are you sure that on the remote server that
/data0/htdocs/www/forum/path/to/file.php exists?

On Mon, May 31, 2010 at 12:43 PM, Mickie D <nginx-forum@nginx.us> wrote:
> Sorry Mike lol
>
> Could it be that one server is running fpm and the other is cgi ?
>
> [code]
> fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
> fastcgi_param  SERVER_SOFTWARE    nginx;
>
> fastcgi_param  QUERY_STRING       $query_string;
> fastcgi_param  REQUEST_METHOD     $request_method;
> fastcgi_param  CONTENT_TYPE       $content_type;
> fastcgi_param  CONTENT_LENGTH     $content_length;
>
> fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
> 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  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;
>
>
> [/code]
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,92738,92794#msg-92794
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Load Balancing PHP

Sorry Mike lol

Could it be that one server is running fpm and the other is cgi ?

[code]
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;

fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
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 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;


[/code]

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,92738,92794#msg-92794


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Load Balancing PHP

your nginx's conf:

include fcgi.conf;

On Mon, May 31, 2010 at 12:29 PM, Mickie D <nginx-forum@nginx.us> wrote:
> Hi Mike
>
> I do not have a fcgi.conf ?
>
> I have a spawn-fcgi
>
> [code]/usr/bin/spawn-fcgi[/code]
>
> Thanks Mike
>
> Mick
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,92738,92787#msg-92787
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Load Balancing PHP

Hi Mike

I do not have a fcgi.conf ?

I have a spawn-fcgi

[code]/usr/bin/spawn-fcgi[/code]

Thanks Mike

Mick

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,92738,92787#msg-92787


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Load Balancing PHP

Check the script_filename in fcgi.conf (post it) it should be in caps
too but I'm on my iPhone :)

If that looks okay then make sure the file is accessable in the right
location on the remote hosts. Cause that's how PHP throws a 404 (that
is so annoying)

Jerome maybe php-fpm sapi could be patched to throw a 404 header and
something resembling a proper error? ;)

On May 31, 2010, at 11:53 AM, "Mickie D" <nginx-forum@nginx.us> wrote:

> [code]
> upstream newsite {
> server 127.0.0.1:9000;
> server 15.82.114.196:9001;
> }
>
> server
> {
> listen 80;
> server_name thissite.com;
> index index.html index.htm index.php;
> root /data0/htdocs/www/forum;
>
>
>
> location ~ .*\.php?$
> {
> include fcgi.conf;
> fastcgi_pass newsite;
> fastcgi_index index.php;
>
>
> }
> [/code]
>
>
> I think this might be a permission thing ? but I have no idea how to
> fix it
>
> Still getting the:
>
> [b]no input file specified[/b]
>
> Not sure how to make the main server work with my other server ?
>
> Thank you very much
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,92738,92775#msg-92775
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Load Balancing PHP

[code]
upstream newsite {
server 127.0.0.1:9000;
server 15.82.114.196:9001;
}

server
{
listen 80;
server_name thissite.com;
index index.html index.htm index.php;
root /data0/htdocs/www/forum;

location ~ .*\.php?$
{
include fcgi.conf;
fastcgi_pass newsite;
fastcgi_index index.php;


}
[/code]


I think this might be a permission thing ? but I have no idea how to fix it

Still getting the:

[b]no input file specified[/b]

Not sure how to make the main server work with my other server ?

Thank you very much

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,92738,92775#msg-92775


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Load Balancing PHP

I managed to get it working KIND OFF lol.

I edited the php file

nano /etc/rc.d/init.d/php_cgi

There you can set the IP address and the port for php and it will start with your ip and port of choice.

I now have another problem :(

This is my code and it is load balancing 50% to each server now :)

but I get 50% of pages white with the words:

[b]no input file specified[/b]

Thank you for any help

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,92738,92753#msg-92753


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Packages for Ubuntu 10.04 LTS... Re: nginx-0.8.39

<quote who="Igor Sysoev">

> Changes with nginx 0.8.39

Built (but pending publication) for Ubuntu 10.04 LTS in my devel PPA (note
that as of this upload, I am no longer building for Ubutu 8.04 LTS):

https://launchpad.net/~jdub/+archive/devel

Thanks, Igor!

- Jeff

--
The Great Australian Internet Blackout http://www.internetblackout.com.au/

No clue is good clue.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Load Balancing PHP

Hi there I am trying to load balance my website between 2 servers.

I have set them both up to mirror each other

But they are a forum and using PHP ???

This is the code I have but it will only use one site.

It only uses the 127.0.0.1 local address and will not contact my other PHP server ?

I opened the port 9000 on both machines via iptables ???

[code]
upstream newsite {
server 127.0.0.1:9000;
server 15.82.114.196:9000;
}

server
{
listen 80;
server_name thissite.com;
index index.html index.htm index.php;
root /data0/htdocs/www/forum;

location ~ .*\.php?$
{
include fcgi.conf;
fastcgi_pass newsite;
fastcgi_index index.php;


}
[/code]

Thank you very much

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,92738,92738#msg-92738


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: upstream using header value

On Monday, May 31, 2010, Weibin Yao <nbubingo@gmail.com> wrote:
> My module can do similar thing for your need. But my module uses the cookie to dispatch the requests.
> http://code.google.com/p/nginx-upstream-jvm-route/

Do you know of any Debian/ubuntu packages which include your module?
Obviously I can build from source, but widely-used packages are so
much easier from an operational standpoint. Auditors like them too...

For that matter, what is the process for a module like this getting
into mainline nginx? I would think that nginx->Tomcat is a common use
case based on the number of questions in this forum, and most
Servlet-based applications which run on Tomcat require sticky sessions
based on session cookie (source IP isn't reliable in a mobile device
world).

--
RPM

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Dynamic Upstream Provider List

Hi,

> I am working on a load balancing system where the upstream providers need
> to change at runtime. The available peer group will be routed either by a
> hash, or by round robin, but the size of the peer group might change
> between any request.

Do you really need this list to be dynamic? Maybe static list of backends
that are dynamically marked as either "up" or "down" is good enough? If so,
please take a look at ngx_supervisord [1] (you will probably want to use it
with "supervisord none;" setting). You can also use it together with
health-check module to automatically mark failed backends as "down".

[1] http://labs.frickle.com/nginx_ngx_supervisord/
[2] http://github.com/cep21/healthcheck_nginx_upstreams

Best regards,
Piotr Sikora < piotr.sikora@frickle.com >


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Dynamic Upstream Provider List

I do this by overwriting a conf included file and gracefully restarting,
how often are you expecting this to change?

On 31/05/10 11:34 AM, rovar wrote:
> I am working on a load balancing system where the upstream providers need to change at runtime. The available peer group will be routed either by a hash, or by round robin, but the size of the peer group might change between any request.
>
> The easy way seems to be to bypass the upstream http functionality altogether and simply return the appropriate peer from the callback in r->upstream->peer.get
>
> Will this work?
> Does something else already do this?
> If not, what is a more idiomatic way to write this module?
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,92715,92715#msg-92715
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
>


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Dynamic Upstream Provider List

I am working on a load balancing system where the upstream providers need to change at runtime. The available peer group will be routed either by a hash, or by round robin, but the size of the peer group might change between any request.

The easy way seems to be to bypass the upstream http functionality altogether and simply return the appropriate peer from the callback in r->upstream->peer.get

Will this work?
Does something else already do this?
If not, what is a more idiomatic way to write this module?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,92715,92715#msg-92715


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

nginx-0.8.39

Changes with nginx 0.8.39 31 May 2010

*) Bugfix: an inherited "alias" directive worked incorrectly in
inclusive location.

*) Bugfix: in "alias" with variables and "try_files" directives
combination.

*) Bugfix: listen unix domain and IPv6 sockets did not inherit while
online upgrade.
Thanks to Maxim Dounin.


--
Igor Sysoev
http://sysoev.ru/en/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: XML files truncated

I was looking for documentation about this,
thks for the tip

Axel

Le 31 mai 2010 à 16:40, Igor Sysoev a écrit :

> On Mon, May 31, 2010 at 04:36:31PM +0200, Axel wrote:
>
>> Maxim,
>>
>> My mistake: when I got your response, I checked permissions on /usr and /usr/local but not on /usr/local/nginx
>> I added +x on nginx and it seems to be working now.
>>
>> Thanks a lot !!
>>
>> Axel
>
> BTW, you may want to move temporary files directories in other place:
>
> http {
> client_body_temp_path /spool/nginx/client_temp;
> fastcgi_temp_path /spool/nginx/fastcgi_temp;
> proxy_temp_path /spool/nginx/proxy_temp;
>
> and set appropriate rights and user ownership only for these directories.
>
>> Le 31 mai 2010 à 16:18, Maxim Dounin a écrit :
>>
>>> Hello!
>>>
>>> On Mon, May 31, 2010 at 03:58:42PM +0200, Axel wrote:
>>>
>>>> Actually I have these errors quite often, not only for big XML
>>>> files, not only in the fastcgi_temp folder. I have a general
>>>> permission issue:
>>>
>>> [...]
>>>
>>>>> Check if www-data has at least execute access on "/usr",
>>>>> "/usr/local", "/usr/local/nginx".
>>>
>>> Did you done what you were said to?
>>>
>>> Maxim Dounin
>>>
>>> _______________________________________________
>>> nginx mailing list
>>> nginx@nginx.org
>>> http://nginx.org/mailman/listinfo/nginx
>>
>>
>> _______________________________________________
>> nginx mailing list
>> nginx@nginx.org
>> http://nginx.org/mailman/listinfo/nginx
>
> --
> Igor Sysoev
> http://sysoev.ru/en/
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Problem upgrading on the fly when ipv6 is used

On Mon, May 31, 2010 at 05:13:15PM +0400, Maxim Dounin wrote:

> Hello!
>
> On Mon, May 31, 2010 at 07:53:51AM -0400, Usu wrote:
>
> > Ok, it works like a charm thank you!
> > Will it be fixed in the next release of nginx?
>
> It's up to Igor, but most likely it will be fixed.

Yes, I will include it in 0.8.39, thank you.


--
Igor Sysoev
http://sysoev.ru/en/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: XML files truncated

On Mon, May 31, 2010 at 04:36:31PM +0200, Axel wrote:

> Maxim,
>
> My mistake: when I got your response, I checked permissions on /usr and /usr/local but not on /usr/local/nginx
> I added +x on nginx and it seems to be working now.
>
> Thanks a lot !!
>
> Axel

BTW, you may want to move temporary files directories in other place:

http {
client_body_temp_path /spool/nginx/client_temp;
fastcgi_temp_path /spool/nginx/fastcgi_temp;
proxy_temp_path /spool/nginx/proxy_temp;

and set appropriate rights and user ownership only for these directories.

> Le 31 mai 2010 à 16:18, Maxim Dounin a écrit :
>
> > Hello!
> >
> > On Mon, May 31, 2010 at 03:58:42PM +0200, Axel wrote:
> >
> >> Actually I have these errors quite often, not only for big XML
> >> files, not only in the fastcgi_temp folder. I have a general
> >> permission issue:
> >
> > [...]
> >
> >>> Check if www-data has at least execute access on "/usr",
> >>> "/usr/local", "/usr/local/nginx".
> >
> > Did you done what you were said to?
> >
> > Maxim Dounin
> >
> > _______________________________________________
> > nginx mailing list
> > nginx@nginx.org
> > http://nginx.org/mailman/listinfo/nginx
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx

--
Igor Sysoev
http://sysoev.ru/en/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: XML files truncated

Maxim,

My mistake: when I got your response, I checked permissions on /usr and /usr/local but not on /usr/local/nginx
I added +x on nginx and it seems to be working now.

Thanks a lot !!

Axel

Le 31 mai 2010 à 16:18, Maxim Dounin a écrit :

> Hello!
>
> On Mon, May 31, 2010 at 03:58:42PM +0200, Axel wrote:
>
>> Actually I have these errors quite often, not only for big XML
>> files, not only in the fastcgi_temp folder. I have a general
>> permission issue:
>
> [...]
>
>>> Check if www-data has at least execute access on "/usr",
>>> "/usr/local", "/usr/local/nginx".
>
> Did you done what you were said to?
>
> Maxim Dounin
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: XML files truncated

Hello!

On Mon, May 31, 2010 at 03:58:42PM +0200, Axel wrote:

> Actually I have these errors quite often, not only for big XML
> files, not only in the fastcgi_temp folder. I have a general
> permission issue:

[...]

> > Check if www-data has at least execute access on "/usr",
> > "/usr/local", "/usr/local/nginx".

Did you done what you were said to?

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: XML files truncated

Hi,

> Pfff, even when I chmod -R 777 fastcgi_temp errors keep appearing in logs
>
> What am I missing out?

The fact that permissions apply to the whole path.

You need at least +x bit on /usr, /usr/local and /usr/local/nginx.

Best regards,
Piotr Sikora < piotr.sikora@frickle.com >

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: XML files truncated

Do check your php daemon user/groups. Type
ps aux | grep php


Best Regards,

Glen Lumanau

-----Original Message-----
From: Axel <junk@devignon.fr>
Date: Mon, 31 May 2010 15:58:42
To: <nginx@nginx.org>
Reply-To: nginx@nginx.org
Subject: Re: XML files truncated

Hi,

Actually I have these errors quite often, not only for big XML files, not only in the fastcgi_temp folder. I have a general permission issue:

2010/05/31 15:48:07 [crit] 5253#0: *47 open() "/usr/local/nginx/client_body_temp/0000000006" failed (13: Permission denied), client: 93.17.75.131, server: cacti.xxx.com, request: "POST /templates_import.php HTTP/1.1", host: "cacti.xxx.com", referrer: "http://cacti.xxx.com/templates_import.php"
2010/05/31 15:48:16 [crit] 5257#0: *67 open() "/usr/local/nginx/fastcgi_temp/7/00/0000000007" failed (13: Permission denied) while reading upstream, client: 67.195.111.28, server: www.xxx.com, request: "GET /restaurants-suivant-1-tri-ville-en-liste-tag=0-a-20-e HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.xxx.com"
2010/05/31 15:48:26 [error] 5257#0: *76 open() "/var/www/xxx/prod/public/medias/galerie/restaurant-boulogne-billancourt-mon-bistrot-237_1.jpg" failed (2: No such file or directory), client: 66.220.153.246, server: www.xxx.com, request: "GET /medias/galerie/restaurant-boulogne-billancourt-mon-bistrot-237_1.jpg HTTP/1.1", host: "www.xxx.com"
2010/05/31 15:48:57 [error] 5257#0: *102 open() "/var/www/xxx/prod/public/videos/flvplayer.swf" failed (2: No such file or directory), client: 80.17.242.10, server: www.xxx.com, request: "GET /videos/flvplayer.swf HTTP/1.1", host: "www.xxx.com", referrer: "http://www.bigarrade.fr/"
2010/05/31 15:49:03 [crit] 5257#0: *110 open() "/usr/local/nginx/client_body_temp/0000000008" failed (13: Permission denied), client: 93.17.75.131, server: cacti.xxx.com, request: "POST /templates_import.php HTTP/1.1", host: "cacti.xxx.com", referrer: "http://cacti.xxx.com/templates_import.php"
2010/05/31 15:49:09 [crit] 5257#0: *113 open() "/usr/local/nginx/client_body_temp/0000000009" failed (13: Permission denied), client: 93.17.75.131, server: cacti.xxx.com, request: "POST /templates_import.php HTTP/1.1", host: "cacti.xxx.com", referrer: "http://cacti.xxx.com/templates_import.php"


I'm checking the permissions again. Here's what I have:

Nginx is running under www-data:
root@xxx:/usr/local/nginx# ps aux | grep "nginx: worker process"
www-data 5253 0.0 0.0 37288 3012 ? S 15:47 0:00 nginx: worker process
www-data 5254 0.0 0.0 37180 2812 ? S 15:47 0:00 nginx: worker process
www-data 5255 0.0 0.0 37248 2928 ? S 15:47 0:00 nginx: worker process
www-data 5256 0.0 0.0 36948 2700 ? S 15:47 0:00 nginx: worker process
www-data 5257 0.0 0.0 37288 2976 ? S 15:47 0:00 nginx: worker process

Client_body_temp, fastcgi_temp and proxy_temp are readable writable by www-data
root@xxx:/usr/local/nginx# ls -l
total 36
drwxrwxr-- 2 www-data root 4096 2010-05-31 13:43 client_body_temp
drwxrwxr-- 2 root root 4096 2010-05-11 16:05 conf
drwxrwxr-- 12 www-data www-data 4096 2010-05-11 10:50 fastcgi_temp
drwxrwxr-- 2 root root 4096 2010-05-10 20:20 html
drwxrwxr-- 2 root root 4096 2010-05-31 15:47 logs
drwxrwxr-- 2 www-data www-data 4096 2010-05-10 18:22 proxy_temp
drwxrwxr-- 2 root root 4096 2010-05-12 00:00 sbin
drwxrwxr-- 2 root root 4096 2010-05-31 15:22 sites-available
drwxrwxr-- 2 root root 4096 2010-05-31 15:39 sites-enabled


I do not find any solution on google :-((
Should I stop using custom users and go back to nobody?

Thks

Axel


Le 31 mai 2010 à 13:43, Maxim Dounin a écrit :

> Hello!
>
> On Mon, May 31, 2010 at 01:20:06PM +0200, Axel wrote:
>
>> nginx is running under www-data:www-data (it is maybe a bad idea
>> isn't it?). I doublechecked filesystem permission and issued a
>> chown -R www-data: fastcgi_temp && chmod -R 664 fastcgi_temp.
>> This didn't solve the issue. Here is some debug information
>> below.
>
> [...]
>
>> ## DEBUG LOG:
>> 2010/05/31 12:36:52 [crit] 22005#0: *5 open()
>> "/usr/local/nginx/fastcgi_temp/1/00/0000000001" failed (13:
>> Permission denied) while reading upstream, client: 93.17.75.xxx,
>
> Check if www-data has at least execute access on "/usr",
> "/usr/local", "/usr/local/nginx".
>
> Maxim Dounin
>
>_______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: XML files truncated

Pfff, even when I chmod -R 777 fastcgi_temp errors keep appearing in logs

What am I missing out?

Thks

Le 31 mai 2010 à 13:43, Maxim Dounin a écrit :

> Hello!
>
> On Mon, May 31, 2010 at 01:20:06PM +0200, Axel wrote:
>
>> nginx is running under www-data:www-data (it is maybe a bad idea
>> isn't it?). I doublechecked filesystem permission and issued a
>> chown -R www-data: fastcgi_temp && chmod -R 664 fastcgi_temp.
>> This didn't solve the issue. Here is some debug information
>> below.
>
> [...]
>
>> ## DEBUG LOG:
>> 2010/05/31 12:36:52 [crit] 22005#0: *5 open()
>> "/usr/local/nginx/fastcgi_temp/1/00/0000000001" failed (13:
>> Permission denied) while reading upstream, client: 93.17.75.xxx,
>
> Check if www-data has at least execute access on "/usr",
> "/usr/local", "/usr/local/nginx".
>
> Maxim Dounin
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: XML files truncated

Hi,

Actually I have these errors quite often, not only for big XML files, not only in the fastcgi_temp folder. I have a general permission issue:

2010/05/31 15:48:07 [crit] 5253#0: *47 open() "/usr/local/nginx/client_body_temp/0000000006" failed (13: Permission denied), client: 93.17.75.131, server: cacti.xxx.com, request: "POST /templates_import.php HTTP/1.1", host: "cacti.xxx.com", referrer: "http://cacti.xxx.com/templates_import.php"
2010/05/31 15:48:16 [crit] 5257#0: *67 open() "/usr/local/nginx/fastcgi_temp/7/00/0000000007" failed (13: Permission denied) while reading upstream, client: 67.195.111.28, server: www.xxx.com, request: "GET /restaurants-suivant-1-tri-ville-en-liste-tag=0-a-20-e HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.xxx.com"
2010/05/31 15:48:26 [error] 5257#0: *76 open() "/var/www/xxx/prod/public/medias/galerie/restaurant-boulogne-billancourt-mon-bistrot-237_1.jpg" failed (2: No such file or directory), client: 66.220.153.246, server: www.xxx.com, request: "GET /medias/galerie/restaurant-boulogne-billancourt-mon-bistrot-237_1.jpg HTTP/1.1", host: "www.xxx.com"
2010/05/31 15:48:57 [error] 5257#0: *102 open() "/var/www/xxx/prod/public/videos/flvplayer.swf" failed (2: No such file or directory), client: 80.17.242.10, server: www.xxx.com, request: "GET /videos/flvplayer.swf HTTP/1.1", host: "www.xxx.com", referrer: "http://www.bigarrade.fr/"
2010/05/31 15:49:03 [crit] 5257#0: *110 open() "/usr/local/nginx/client_body_temp/0000000008" failed (13: Permission denied), client: 93.17.75.131, server: cacti.xxx.com, request: "POST /templates_import.php HTTP/1.1", host: "cacti.xxx.com", referrer: "http://cacti.xxx.com/templates_import.php"
2010/05/31 15:49:09 [crit] 5257#0: *113 open() "/usr/local/nginx/client_body_temp/0000000009" failed (13: Permission denied), client: 93.17.75.131, server: cacti.xxx.com, request: "POST /templates_import.php HTTP/1.1", host: "cacti.xxx.com", referrer: "http://cacti.xxx.com/templates_import.php"


I'm checking the permissions again. Here's what I have:

Nginx is running under www-data:
root@xxx:/usr/local/nginx# ps aux | grep "nginx: worker process"
www-data 5253 0.0 0.0 37288 3012 ? S 15:47 0:00 nginx: worker process
www-data 5254 0.0 0.0 37180 2812 ? S 15:47 0:00 nginx: worker process
www-data 5255 0.0 0.0 37248 2928 ? S 15:47 0:00 nginx: worker process
www-data 5256 0.0 0.0 36948 2700 ? S 15:47 0:00 nginx: worker process
www-data 5257 0.0 0.0 37288 2976 ? S 15:47 0:00 nginx: worker process

Client_body_temp, fastcgi_temp and proxy_temp are readable writable by www-data
root@xxx:/usr/local/nginx# ls -l
total 36
drwxrwxr-- 2 www-data root 4096 2010-05-31 13:43 client_body_temp
drwxrwxr-- 2 root root 4096 2010-05-11 16:05 conf
drwxrwxr-- 12 www-data www-data 4096 2010-05-11 10:50 fastcgi_temp
drwxrwxr-- 2 root root 4096 2010-05-10 20:20 html
drwxrwxr-- 2 root root 4096 2010-05-31 15:47 logs
drwxrwxr-- 2 www-data www-data 4096 2010-05-10 18:22 proxy_temp
drwxrwxr-- 2 root root 4096 2010-05-12 00:00 sbin
drwxrwxr-- 2 root root 4096 2010-05-31 15:22 sites-available
drwxrwxr-- 2 root root 4096 2010-05-31 15:39 sites-enabled


I do not find any solution on google :-((
Should I stop using custom users and go back to nobody?

Thks

Axel


Le 31 mai 2010 à 13:43, Maxim Dounin a écrit :

> Hello!
>
> On Mon, May 31, 2010 at 01:20:06PM +0200, Axel wrote:
>
>> nginx is running under www-data:www-data (it is maybe a bad idea
>> isn't it?). I doublechecked filesystem permission and issued a
>> chown -R www-data: fastcgi_temp && chmod -R 664 fastcgi_temp.
>> This didn't solve the issue. Here is some debug information
>> below.
>
> [...]
>
>> ## DEBUG LOG:
>> 2010/05/31 12:36:52 [crit] 22005#0: *5 open()
>> "/usr/local/nginx/fastcgi_temp/1/00/0000000001" failed (13:
>> Permission denied) while reading upstream, client: 93.17.75.xxx,
>
> Check if www-data has at least execute access on "/usr",
> "/usr/local", "/usr/local/nginx".
>
> Maxim Dounin
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Problem upgrading on the fly when ipv6 is used

Hello!

On Mon, May 31, 2010 at 07:53:51AM -0400, Usu wrote:

> Ok, it works like a charm thank you!
> Will it be fixed in the next release of nginx?

It's up to Igor, but most likely it will be fixed.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Nginx reload

Thanks for the quick reply.
But what is the right way for dynamic weight management of upstreams?

2010/5/31 Maxim Dounin <mdounin@mdounin.ru>
Hello!

On Mon, May 31, 2010 at 03:44:56PM +0400, Andrey Feldman wrote:

> We need to change upstreams weight dynamicly(every 15 sec.), is that normal
> to reload nginx so frequently in prodution?

Not really, but this depends on your workload.

Every reload gracefully shutdowns old workers.  This means that if
there are long-lived requests (big downloads from clients with
slow links etc.) old workers may still be here for a while.  And
they still consume memory and so on.  In my practice shutdown time
reached several hours in some cases.

If you reload every 15 seconds and shutdown takes longer - you
have problem.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx



--
--
Andrey Feldman

Re: Problem upgrading on the fly when ipv6 is used

Ok, it works like a charm thank you!
Will it be fixed in the next release of nginx?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,91799,92645#msg-92645


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Nginx reload

Hello!

On Mon, May 31, 2010 at 03:44:56PM +0400, Andrey Feldman wrote:

> We need to change upstreams weight dynamicly(every 15 sec.), is that normal
> to reload nginx so frequently in prodution?

Not really, but this depends on your workload.

Every reload gracefully shutdowns old workers. This means that if
there are long-lived requests (big downloads from clients with
slow links etc.) old workers may still be here for a while. And
they still consume memory and so on. In my practice shutdown time
reached several hours in some cases.

If you reload every 15 seconds and shutdown takes longer - you
have problem.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Nginx reload

We need to change upstreams weight dynamicly(every 15 sec.), is that normal to reload nginx so frequently in prodution?

--
--
Andrey Feldman

Re: XML files truncated

Hello!

On Mon, May 31, 2010 at 01:20:06PM +0200, Axel wrote:

> nginx is running under www-data:www-data (it is maybe a bad idea
> isn't it?). I doublechecked filesystem permission and issued a
> chown -R www-data: fastcgi_temp && chmod -R 664 fastcgi_temp.
> This didn't solve the issue. Here is some debug information
> below.

[...]

> ## DEBUG LOG:
> 2010/05/31 12:36:52 [crit] 22005#0: *5 open()
> "/usr/local/nginx/fastcgi_temp/1/00/0000000001" failed (13:
> Permission denied) while reading upstream, client: 93.17.75.xxx,

Check if www-data has at least execute access on "/usr",
"/usr/local", "/usr/local/nginx".

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: XML files truncated

Hi again,

nginx is running under www-data:www-data (it is maybe a bad idea isn't it?). I doublechecked filesystem permission and issued a chown -R www-data: fastcgi_temp && chmod -R 664 fastcgi_temp.
This didn't solve the issue. Here is some debug information below.

---------

root@o:/usr/local/nginx# nginx -V
nginx version: nginx/0.7.65
built by gcc 4.3.3 (Ubuntu 4.3.3-5ubuntu4)
configure arguments: --with-cc-opt=-O3 --user=www-data --group=www-data --add-module=./modules/nginx_mp4_streaming_public --with-http_stub_status_module

## CONFIG
user www-data www-data;
worker_processes 5;

events {
use epoll;
worker_connections 2048;
}

http {
include mime.types;
include fastcgi_params;
default_type application/octet-stream;

sendfile off;
tcp_nopush on;
tcp_nodelay on;
server_tokens off;
ignore_invalid_headers on;
# client_body_buffer_size 8k;
# client_header_buffer_size 1k;
# client_max_body_size 1k;
# large_client_header_buffers 1 1k;

client_body_timeout 5;
client_header_timeout 5;
keepalive_timeout 15 14;
send_timeout 5;

gzip on;
gzip_comp_level 4;
gzip_proxied any;
gzip_buffers 16 8k;
gzip_types text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript application/xhtml+xml;

expires 1d;

error_log /var/log/nginx/error.log notice;
access_log /var/log/nginx/access.log;


include /usr/local/nginx/sites-enabled/*;
}


server
{
listen 80;
server_name www.xxx.com;
root /var/www/xxx/prod/public;
index index.php;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/xxx_access.log main;

location /
{

try_files $uri $uri/ @kohana;

fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;

include fastcgi_params;
}

location ~ /\. {
deny all;
}

location @kohana
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
include fastcgi_params;
}

location ~* \.css|\.js|\.jpg|\.jpeg|\.png|\.gif|\.swf|\.svg|\.tiff$ {
expires 30d;
}
}


## DEBUG LOG:
2010/05/31 12:36:52 [crit] 22005#0: *5 open() "/usr/local/nginx/fastcgi_temp/1/00/0000000001" failed (13: Permission denied) while reading upstream, client: 93.17.75.xxx, server: xxx, request: "GET /rss/restaurants/sitemap HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.xxx.com"
2010/05/31 12:41:37 [warn] 22008#0: *312 an upstream response is buffered to a temporary file /usr/local/nginx/fastcgi_temp/7/00/0000000007 while reading upstream, client: 93.17.75.xxx, server: www.xxx.com, request: "GET /rss/restaurants/sitemap HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.xxx.com"
2010/05/31 12:55:47 [crit] 22008#0: *1234 open() "/usr/local/nginx/fastcgi_temp/6/04/0000000046" failed (13: Permission denied) while reading upstream, client: 128.30.52.xxx, server: www.xxx.com, request: "GET /rss/restaurants/sitemap HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.xxx.com"


Thks a lot

Axel


Le 31 mai 2010 à 12:41, Maxim Dounin a écrit :

> Hello!
>
> On Mon, May 31, 2010 at 11:43:21AM +0200, Axel wrote:
>
>> Hi guys,
>>
>> I recently migrated from Apache to Nginx. Really cool. My
>> website is much faster. BUT I have a really weird issue that
>> didn't occur with Apache. It seems that some big files are
>> sometimes truncated by the server. For instance, I generate a
>> 200 entries videos sitemap (4600 lines) for Google (Google
>> allows up to 50 000 entries FYI). Quite often, Google cannot
>> parse this XML file because it is truncated in the middle and
>> the XML is therefore no longer valid. It seems I have the same
>> issue when I browse this XML into Safari or Firefox. When I try
>> a feed validator (http://validator.w3.org/feed/check.cgi), the
>> test fails 8 times out of 10 and the source is clearly
>> truncated.
>>
>> I tried to disable gzip encoding or to adapt quite a lot of
>> settings. Nothing did the trick. Have U any idea that could
>> help?
>> Thks a lot
>
> 1. As Anton already suggested, try looking into error log. From
> symptoms you describe it looks like nginx can't write to
> fastcgi_temp_path/proxy_temp_path, it should complain in logs.
>
> 2. If the above doesn't help, please follow this topic:
>
> http://wiki.nginx.org/NginxDebugging
>
> You have to provide config, nginx -V and debug log of a request
> which exposes the problem.
>
> Maxim Dounin
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: XML files truncated

Hello!

On Mon, May 31, 2010 at 11:43:21AM +0200, Axel wrote:

> Hi guys,
>
> I recently migrated from Apache to Nginx. Really cool. My
> website is much faster. BUT I have a really weird issue that
> didn't occur with Apache. It seems that some big files are
> sometimes truncated by the server. For instance, I generate a
> 200 entries videos sitemap (4600 lines) for Google (Google
> allows up to 50 000 entries FYI). Quite often, Google cannot
> parse this XML file because it is truncated in the middle and
> the XML is therefore no longer valid. It seems I have the same
> issue when I browse this XML into Safari or Firefox. When I try
> a feed validator (http://validator.w3.org/feed/check.cgi), the
> test fails 8 times out of 10 and the source is clearly
> truncated.
>
> I tried to disable gzip encoding or to adapt quite a lot of
> settings. Nothing did the trick. Have U any idea that could
> help?
> Thks a lot

1. As Anton already suggested, try looking into error log. From
symptoms you describe it looks like nginx can't write to
fastcgi_temp_path/proxy_temp_path, it should complain in logs.

2. If the above doesn't help, please follow this topic:

http://wiki.nginx.org/NginxDebugging

You have to provide config, nginx -V and debug log of a request
which exposes the problem.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: XML files truncated

Hi Anton,

very good idea. Here what I get:

2010/05/31 12:36:52 [crit] 22005#0: *5 open() "/usr/local/nginx/fastcgi_temp/1/00/0000000001" failed (13: Permission denied) while reading upstream, client: 93.17.75.xxx, server: www.xxx.com, request: "GET /rss/restaurants/sitemap HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.xxx.com"

Weird ...

Thks
Axel


Le 31 mai 2010 à 12:21, Anton Yuzhaninov a écrit :

> On 31.05.2010 13:43, Axel wrote:
>> I recently migrated from Apache to Nginx. Really cool. My website is much faster. BUT I have a really weird issue that didn't occur with Apache. It seems that some big files are sometimes truncated by the server. For instance, I generate a 200 entries videos sitemap (4600 lines) for Google (Google allows up to 50 000 entries FYI). Quite often, Google cannot parse this XML file because it is truncated in the middle and the XML is therefore no longer valid. It seems I have the same issue when I browse this XML into Safari or Firefox. When I try a feed validator (http://validator.w3.org/feed/check.cgi), the test fails 8 times out of 10 and the source is clearly truncated.
>>
>> I tried to disable gzip encoding or to adapt quite a lot of settings. Nothing did the trick. Have U any idea that could help?
>> Thks a lot
>
> enable error_log at notice level (or higher) and see in logs when error occurs.
>
> --
> Anton Yuzhaninov
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: XML files truncated

On 31.05.2010 13:43, Axel wrote:
> I recently migrated from Apache to Nginx. Really cool. My website is much faster. BUT I have a really weird issue that didn't occur with Apache. It seems that some big files are sometimes truncated by the server. For instance, I generate a 200 entries videos sitemap (4600 lines) for Google (Google allows up to 50 000 entries FYI). Quite often, Google cannot parse this XML file because it is truncated in the middle and the XML is therefore no longer valid. It seems I have the same issue when I browse this XML into Safari or Firefox. When I try a feed validator (http://validator.w3.org/feed/check.cgi), the test fails 8 times out of 10 and the source is clearly truncated.
>
> I tried to disable gzip encoding or to adapt quite a lot of settings. Nothing did the trick. Have U any idea that could help?
> Thks a lot

enable error_log at notice level (or higher) and see in logs when error occurs.

--
Anton Yuzhaninov

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

XML files truncated

Hi guys,

I recently migrated from Apache to Nginx. Really cool. My website is much faster. BUT I have a really weird issue that didn't occur with Apache. It seems that some big files are sometimes truncated by the server. For instance, I generate a 200 entries videos sitemap (4600 lines) for Google (Google allows up to 50 000 entries FYI). Quite often, Google cannot parse this XML file because it is truncated in the middle and the XML is therefore no longer valid. It seems I have the same issue when I browse this XML into Safari or Firefox. When I try a feed validator (http://validator.w3.org/feed/check.cgi), the test fails 8 times out of 10 and the source is clearly truncated.

I tried to disable gzip encoding or to adapt quite a lot of settings. Nothing did the trick. Have U any idea that could help?
Thks a lot


Axel


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Problem upgrading on the fly when ipv6 is used

Hello!

On Mon, May 31, 2010 at 03:57:28AM -0400, Usu wrote:

> Hello,
>
> thanks for the help, I tried patching the 0.8.38 release but it's giving me an error:
>
> root@localhost:/usr/src/nginx-0.8.38# patch -p1 < ipv6.diff
> patching file src/core/ngx_connection.c
> Hunk #1 FAILED at 96.
> 1 out of 1 hunk FAILED -- saving rejects to file src/core/ngx_connection.c.rej
>
> And here's the file generated:

[...]

> Am I doing something wrong?

It's mailing list <-> forum gateway which tried to interpret
bbcodes and mungled patch. You may obtain correct one from here:

http://nginx.org/pipermail/nginx/2010-May/020621.html

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Problem upgrading on the fly when ipv6 is used

Hello,

thanks for the help, I tried patching the 0.8.38 release but it's giving me an error:

root@localhost:/usr/src/nginx-0.8.38# patch -p1 < ipv6.diff
patching file src/core/ngx_connection.c
Hunk #1 FAILED at 96.
1 out of 1 hunk FAILED -- saving rejects to file src/core/ngx_connection.c.rej

And here's the file generated:

[code]
*************** ngx_set_inherited_sockets(ngx_cycle_t *c
*** 96,109 ****
ls = cycle->listening.elts;
for (i = 0; i < cycle->listening.nelts; i++) {

- /* AF_INET only */
-
- ls.sockaddr = ngx_palloc(cycle->pool, sizeof(struct sockaddr_in));
if (ls.sockaddr == NULL) {
return NGX_ERROR;
}

- ls.socklen = sizeof(struct sockaddr_in);
if (getsockname(ls.fd, ls.sockaddr, &ls.socklen) == -1) {
ngx_log_error(NGX_LOG_CRIT, cycle->log, ngx_socket_errno,
"getsockname() of the inherited "
--- 96,107 ----
ls = cycle->listening.elts;
for (i = 0; i < cycle->listening.nelts; i++) {

+ ls.sockaddr = ngx_palloc(cycle->pool, NGX_SOCKADDRLEN);
if (ls.sockaddr == NULL) {
return NGX_ERROR;
}

+ ls.socklen = NGX_SOCKADDRLEN;
if (getsockname(ls.fd, ls.sockaddr, &ls.socklen) == -1) {
ngx_log_error(NGX_LOG_CRIT, cycle->log, ngx_socket_errno,
"getsockname() of the inherited "
[/code]

Am I doing something wrong?

Thanks,
Andrea

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,91799,92579#msg-92579


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

2010年5月30日星期日

Re: upstream using header value

PatRoy at 2010-5-29 4:41 wrote:
> Hi,
>
> Can someone tell me if it's possible to proxy the requests to
> different servers by using an http header value. So for example we
> have 2 web servers and if the request has the http header "group_id"
> between 0 and 100 then those go to server #1, and between 100 and 200,
> they go to server #2?
>
> Can you do this with a module like upstream_hash ??
>
My module can do similar thing for your need. But my module uses the
cookie to dispatch the requests.
http://code.google.com/p/nginx-upstream-jvm-route/

> Thank you
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
>


--
Weibin Yao


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: upstream using header value

I can't help but think maybe you should design the app to be a little
less stateful.

On 28/05/10 4:41 PM, PatRoy wrote:
> Hi,
>
> Can someone tell me if it's possible to proxy the requests to
> different servers by using an http header value. So for example we
> have 2 web servers and if the request has the http header "group_id"
> between 0 and 100 then those go to server #1, and between 100 and 200,
> they go to server #2?
>
> Can you do this with a module like upstream_hash ??
>
> Thank you
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
>

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

nginx ignores access_log directive when post_action specifie

Hi,

in the location below nginx writes a custom download log. Everything
works fine except when there is a post_action directive.

I seems that nginx skips the access_log directive but I don't understand
why. Any help is greatly appreciated.

Here is the config:

location /download_intern/ {
internal;

if ($uri ~* ^/download_intern/([0-9]+)/) {
set $transferID $1;
set $server $arg_ip;
set $url $arg_url;
proxy_pass http://$server:80/$url;
break;
}


log_format download '$remote_addr [$time_local]
$upstream_cache_status "$scheme://$host$request_uri" $status
[$transferID] $body_bytes_sent';

access_log /opt/nginx/logs/server.download_log download;


# without this line the download log file is being written
post_action /done;
}


location /done {
internal;
# log the transfer on the main server
proxy_pass http://xxx.xxx.xxx.xxx:80/download_end/?tid=$transferID;
}
--
Posted via http://www.ruby-forum.com/.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Problem upgrading on the fly when ipv6 is used

# HG changeset patch
# User Maxim Dounin <mdounin@mdounin.ru>
# Date 1275262166 -14400
# Node ID 478595e4115aecc70c7c9ddd2f455908dc4c2542
# Parent 7cbc7affef15fa626886f4ae35fc80916ab0ce21
Handle not only AF_INET inherited sockets.

diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c
--- a/src/core/ngx_connection.c
+++ b/src/core/ngx_connection.c
@@ -96,14 +96,12 @@ ngx_set_inherited_sockets(ngx_cycle_t *c
ls = cycle->listening.elts;
for (i = 0; i < cycle->listening.nelts; i++) {

- /* AF_INET only */
-
- ls[i].sockaddr = ngx_palloc(cycle->pool, sizeof(struct sockaddr_in));
+ ls[i].sockaddr = ngx_palloc(cycle->pool, NGX_SOCKADDRLEN);
if (ls[i].sockaddr == NULL) {
return NGX_ERROR;
}

- ls[i].socklen = sizeof(struct sockaddr_in);
+ ls[i].socklen = NGX_SOCKADDRLEN;
if (getsockname(ls[i].fd, ls[i].sockaddr, &ls[i].socklen) == -1) {
ngx_log_error(NGX_LOG_CRIT, cycle->log, ngx_socket_errno,
"getsockname() of the inherited "
Hello!

On Sat, May 29, 2010 at 03:23:54AM -0400, Usu wrote:

> I've always upgraded nginx on the fly following this guide:
> http://wiki.nginx.org/NginxCommandLine without problems.
> I recently added IPv6 support to nginx and now, when I need to
> upgrade it, it doesn't start the new instance when I send the
> USR2 signal to the master process, giving the following erros:
> [code]
> 2010/05/29 09:05:52 [notice] 21060#0: using inherited sockets from "14;15;"
> 2010/05/29 09:05:52 [emerg] 21060#0: bind() to [2001:41d0:2:8673::1]:80 failed (98: Address already in use)
> [emerg]: bind() to [2001:41d0:2:8673::1]:80 failed (98: Address already in use)

[...]

Attached patch should resolve this issue.

Maxim Dounin

Re: error directive help with 404

Hello!

On Fri, May 28, 2010 at 06:23:13PM -0400, robinsonc494 wrote:

> Hi all,
> I've just moved from an apache2 server and i'm trying to set up nginx.
>
> Its installed, compiled from source and running fine.
> In the process of fine tuning my setup i noticed my 404's aren't doing what i want.
>
> I have my wordpress blog setup with php-fpm for php
>
> when a 404 happens on a file with .html or /no-existent-url
> the 404 does what i expect and wordpress handles it with my custom page.
>
> if i enter domain.com/somepage.php i get the nasty default page that browsers server.
> in I.E especially

So you have 404 returned from php, and it's returned to browser as
is. Use fastcgi_intercept_errors to intercept backend errors, see
here:

http://wiki.nginx.org/NginxHttpFcgiModule#fastcgi_intercept_errors

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: nginx-0.8.38

Hello!

On Fri, May 28, 2010 at 08:36:00PM +0200, Victor Iggy wrote:

> new nginx 0.8.38 segfaults on start; here is the ktruss output.
>
> http://victori.uploadbooth.com/pastes/fwqqcvtHP
>
> OS: OpenSolaris SNV98 / tried compiling with gcc-4.1.0 and suncc; both
> segfault.

You may want to provide nginx -V output and backtrace, see here
for details:

http://wiki.nginx.org/NginxDebugging

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Reverse Proxy for Exchange 2010 Outlook Anywhere (RPC over HTTPS)

Hi,

Ngnix has been configured as a reverse Proxy for an Exchange2010-Server (for OWA (Outlook Web Access) and Microsoft-Active-Sync). This works great. But I also want to use nginx for Outlook Anywhere (RPC over HTTPS). But this doesn't work.

This my nginx.conf

[code]
user www-data;
worker_processes 4;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
server_names_hash_bucket_size 64;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
tcp_nodelay on;
gzip on;
gzip_comp_level 5;
gzip_http_version 1.0;
gzip_min_length 0;
gzip_types text/plain text/css image/x-icon application/x-javascript;
gzip_vary on;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
[/code]


and my owa.conf under site-available


[code]
server {
listen 80;
server_name mail.externalDomain.com;

# Redirect any HTTP request to HTTPS
rewrite ^(.*) https://mail.externalDomain.com $1 permanent;

error_log /var/log/nginx/owa-error.log;
access_log /var/log/nginx/owa-access.log;
}

server {
listen 443;
server_name mail.externalDomain.com;

# Redirect from "/" to "/owa" by default
rewrite ^/$ https:// mail.externalDomain.com/owa permanent;

# Enable SSL
ssl on;
ssl_certificate /etc/nginx/ssl.crt/exchange.crt;
ssl_certificate_key /etc/nginx/ssl.key/exchange.key;
ssl_session_timeout 5m;

# Set global proxy settings
proxy_read_timeout 360;

proxy_pass_header Date;
proxy_pass_header Server;

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 ~* ^/owa { proxy_pass https://exchange2010.local; }
location ~* ^/Microsoft-Server-ActiveSync { proxy_pass https://exchange2010.local; }
location ~* ^/ecp { proxy_pass https://exchange2010.local; }
location ~* ^/Rpc { proxy_pass https://exchange2010.local; }
location ~* ^/mailarchiver { proxy_pass https://mailarchiver.local; }
error_log /var/log/nginx/owa-ssl-error.log;
access_log /var/log/nginx/owa-ssl-access.log;
}

server {
listen 443;
server_name autodiscover.externalDomain.com;

# Enable SSL
ssl on;
ssl_certificate /etc/nginx/ssl.crt/exchange.crt;
ssl_certificate_key /etc/nginx/ssl.key/exchange.key;
ssl_session_timeout 5m;

# Set global proxy settings
proxy_read_timeout 360;

proxy_pass_header Date;
proxy_pass_header Server;

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 ~* ^/Autodiscover { proxy_pass https://exchange2010.local; }

error_log /var/log/nginx/owa-ssl-error.log;
access_log /var/log/nginx/owa-ssl-access.log;
}
[/code]

Now if I open the internal URL of Rpc with my Browser i become an authentication, after i have me successful authorized i become a blank site.
if I open the external URL of Rpc with my Browser i become an authentication, after i have me successful authorized i become a "502 Bad Gateway" Error from ngnix.

Has anyone a solution for it?

Another question is it is possible to set nginx case insensitive globe for all locations? Because I can't use ~* for this example.

[code]
location ~* ^/mailarchiver { proxy_pass https://exchange2010.local/mailarchiver3; }
[/code]

So I hope u understand my English but is a long time ago that I have to use it.


Thx and regards

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,92239,92239#msg-92239


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Random Instant 502 Bad Gateway Errors

Hummm ... Always the same problem. Any ideas ?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,91854,92203#msg-92203


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Random Instant 502 Bad Gateway Errors

I've just edit my PHP-FPM conf with :

[code]
<value name="emergency_restart_threshold">30</value>
<value name="emergency_restart_interval">0s</value>
<value name="process_control_timeout">5s</value>
[/code]

I hope it will correct my problem :)

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,91854,92164#msg-92164


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Random Instant 502 Bad Gateway Errors

I've just get a 502 Bad gateway. It's very random but instant ( the server do not take time to show the error message ).
This is strange because any logs appear in Nginx and PHP-FPM. And I've decrease the children value to 64.
I don't understand why this error appear !? For me, it seems that the child is restarted at nginx loading :/

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,91854,92161#msg-92161


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

2010年5月29日星期六

Re: Random Instant 502 Bad Gateway Errors

I've already limit_conn in my config file.

[code]
Active connections: 51
server accepts handled requests
5634 5634 6587
Reading: 1 Writing: 1 Waiting: 49
[/code]

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,91854,92016#msg-92016


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Random Instant 502 Bad Gateway Errors

2010/5/29 TheCrach <nginx-forum@nginx.us>:
> Thank's for your responses.
>
> At peak time I have about 15 children exept if I'm getting attacked :/
> My server is the object of a lot of DoS attacks and it is possible to get 100 children.
> But you have to know that this server is use for a website but it is also the infos server of my 30 servers of downloads.
> I have Suhosin with APC enabled and my website has a SQL cache created by me.
>
> I should decrease the value of children ?

it depends on your system. If your system is able to handle 150
concurent request so you're fine with it. When you're under DOS
attack, your server won't crash. But if all children are working at
same time, new clients won't be able to connect. In this case, the DOS
will be a success (from the point of view of the attacker).

You can look at some interesting nginx modules:
http://wiki.nginx.org/NginxHttpLimitZoneModule
http://wiki.nginx.org/NginxHttpLimitReqModule

>
> And sorry but after activating error logs I have not managed to reproduce the problem and logs are still empty.
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,91854,91998#msg-91998
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Random Instant 502 Bad Gateway Errors

Nginx limit_conn does that, no ?
Look at my Nginx config :)

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,91854,92005#msg-92005


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Random Instant 502 Bad Gateway Errors

is you're getting attacked you shouldn't be allowing it to execute php
you should be blocking it :)

On Sat, May 29, 2010 at 12:35 PM, TheCrach <nginx-forum@nginx.us> wrote:
> Thank's for your responses.
>
> At peak time I have about 15 children exept if I'm getting attacked :/
> My server is the object of a lot of DoS attacks and it is possible to get 100 children.
> But you have to know that this server is use for a website but it is also the infos server of my 30 servers of downloads.
> I have Suhosin with APC enabled and my website has a SQL cache created by me.
>
> I should decrease the value of children ?
>
> And sorry but after activating error logs I have not managed to reproduce the problem and logs are still empty.
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,91854,91998#msg-91998
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Random Instant 502 Bad Gateway Errors

Thank's for your responses.

At peak time I have about 15 children exept if I'm getting attacked :/
My server is the object of a lot of DoS attacks and it is possible to get 100 children.
But you have to know that this server is use for a website but it is also the infos server of my 30 servers of downloads.
I have Suhosin with APC enabled and my website has a SQL cache created by me.

I should decrease the value of children ?

And sorry but after activating error logs I have not managed to reproduce the problem and logs are still empty.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,91854,91998#msg-91998


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

Re: Random Instant 502 Bad Gateway Errors

Yes Mike, that's a very logic things.


Regards,
Joe


On Sun, May 30, 2010 at 1:51 AM, Michael Shadle <mike503@gmail.com> wrote:
Yup. General rule of thumb is roughly how many concurrent php requests you expect at peak time. Hopefully your code runs fast enough to spend less than 1 second processing. Cause if the children are busy it will block until one opens up or until nginx's configured timeout hits.


On May 29, 2010, at 11:24 AM, Jérôme Loyet <jerome@loyet.net> wrote:

2010/5/29 Joe <frumentius@gmail.com>:
Usually using 5 is quiet enough.

either you have a well optimized website with a 99% cache ratio or you
don't have traffic. In the real world, there is so much web apps which
consume a lot of resources and for thoses you'll need much more than 5
children to handle them.


Regards,
Joe


2010/5/30 Michael Shadle <mike503@gmail.com>

150 children is quite a lot. Sure you need that? :)

On May 29, 2010, at 6:02 AM, "TheCrach" <nginx-forum@nginx.us> wrote:

Hi,

I'm French and I've some problem with nginx 0.8.38 and PHP-FPM 5.3.0 with
Suhosin patch :/
I've got random instant 502 Bad Gateway errors, generaly a refresh make
the page works again but it's really anoying.

Nginx Config :
[code]
user www;
worker_processes 1;
daemon on;

error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;

worker_rlimit_nofile 32000;

events {
 worker_connections  4096;
 use epoll;
}

http {

 include       mime.types;
 default_type  text/plain;

 limit_zone http $binary_remote_addr 1m;
 limit_zone https $binary_remote_addr 1m;

 client_body_timeout 8;
 client_header_timeout 5;
 keepalive_timeout 5;
 keepalive_requests 10;
 send_timeout 8;

 client_max_body_size 512k;

 access_log off;
 error_log off;

 client_header_buffer_size    16k;
 large_client_header_buffers  16 16k;

 output_buffers   2 32k;
 postpone_output  1460;

 sendfile         on;
 tcp_nopush       on;
 tcp_nodelay      on;
 reset_timedout_connection on;

 ignore_invalid_headers on;
 autoindex on;
 msie_padding on;

 gzip  on;
 gzip_http_version 1.1;
 gzip_vary on;
 gzip_comp_level 6;
 gzip_proxied any;
 gzip_types text/plain text/css application/json
application/x-javascript text/xml application/xml application/xml+rss
text/javascript;
 gzip_buffers 16 16k;
 gzip_disable "MSIE [1-6].(?!.*SV1)";

 server
 {
   listen 80 default rcvbuf=8192 sndbuf=16384 backlog=65536;
   index  index.html index.htm index.php;
   root   /home/www/;

   limit_conn http 10;

   access_log off;

  location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
   expires 3600;
   break;
  }

  location ~ \.php(/|$) {
      include fastcgi_params;
  }

  location ~ \.php5(/|$) {
      include fastcgi_params;
  }

  location ~ \.php4(/|$) {
      include fastcgi_params;
  }

  location /cache/status {
      stub_status on;
      access_log off;
  }
 }
[/code]

Fastcgi params :

[code]
fastcgi_connect_timeout 5;
fastcgi_send_timeout 8;
fastcgi_buffer_size 512k;
fastcgi_buffers 64 64k;
fastcgi_busy_buffers_size 512k;
fastcgi_temp_file_write_size 512k;
fastcgi_ignore_client_abort on;
fastcgi_intercept_errors on;
fastcgi_read_timeout 45;

fastcgi_pass   unix:/tmp/php.socket;
fastcgi_index  index.php;
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;
fastcgi_param  SERVER_SOFTWARE    RD;
fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;
fastcgi_param  REDIRECT_STATUS    200;
[/code]

PHP-FPM conf :

[code]
<?xml version="1.0" ?>
<configuration>
 <section name="global_options">
     <value name="pid_file">/var/run/php5-fpm.pid</value>
     <value name="error_log">/var/log/php-fpm.log</value>
     <value name="log_level">warn</value>
     <value name="emergency_restart_threshold">60</value>
     <value name="emergency_restart_interval">1m</value>
     <value name="process_control_timeout">4s</value>
     <value name="daemonize">yes</value>
 </section>

 <workers>
     <section name="pool">
         <value name="name">RD</value>
         <value name="listen_address">/tmp/php.socket</value>
         <value name="listen_options">
             <value name="backlog">-1</value>
             <value name="owner">www</value>
             <value name="group">www</value>
             <value name="mode">0666</value>
         </value>

         <value name="php_defines">
         </value>

         <value name="user">www</value>
         <value name="group">www</value>

         <value name="pm">
             <value name="style">static</value>
             <value name="max_children">150</value>
             <value name="apache_like">
                 <value name="StartServers">25</value>
                 <value name="MinSpareServers">5</value>
                 <value name="MaxSpareServers">35</value>
             </value>
         </value>

         <value name="request_terminate_timeout">0s</value>
         <value name="request_slowlog_timeout">0s</value>
         <value name="slowlog">/var/log/php-fpm.log.slow</value>
         <value name="rlimit_files">1024</value>
         <value name="rlimit_core">0</value>
         <value name="chroot"></value>
         <value name="chdir"></value>
         <value name="catch_workers_output">yes</value>
         <value name="max_requests">65536</value>
         <value name="allowed_clients">127.0.0.1</value>

         <value name="environment">
             <value name="HOSTNAME">$HOSTNAME</value>
             <value name="PATH">/usr/local/bin:/usr/bin:/bin</value>
             <value name="TMP">/tmp</value>
             <value name="TMPDIR">/tmp</value>
             <value name="TEMP">/tmp</value>
             <value name="OSTYPE">$OSTYPE</value>
             <value name="MACHTYPE">$MACHTYPE</value>
             <value name="MALLOC_CHECK_">2</value>
         </value>
     </section>
 </workers>
</configuration>
[/code]

Server config :

[code]
Intel Corei5 (Lynnfield) 4x 2.66+ GHz 8 Mo L2 - FSB 1333 MHz
64 bits
8 Go DDR3
Intel SSD X25-M 2x 80 Go RAID    0/1
GigaEthernet
[/code]

If anyone have an idea :)

It's very strange because it's instant and random whereas it would be
timedout all the time :/

Thank's in advance.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,91854,91854#msg-91854


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx



_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx