2011年2月28日星期一

Re: Why NGX_SOCKADDRLEN is 512?

On Mar 1, 2011, at 10:28 , speedfirst wrote:

> For an IPv6, sizeof (struct sockaddr_in6) is only 28bytes, so why set
> NGX_SOCKADDRLEN 512?

src/core/ngx_inet.h

/*
* TODO: autoconfigure NGX_SOCKADDRLEN and NGX_SOCKADDR_STRLEN as
* sizeof(struct sockaddr_storage)
* sizeof(struct sockaddr_un)
* sizeof(struct sockaddr_in6)
* sizeof(struct sockaddr_in)
*/

[...]

#if (NGX_HAVE_UNIX_DOMAIN)
#define NGX_SOCKADDRLEN sizeof(struct sockaddr_un)
#else
#define NGX_SOCKADDRLEN 512

Re: problem with virtual host settings

Hello,

Short answers:
- Add www.example.com to your /etc/hosts
OR
- In your second server block, change "listen 80" to "listen 80 default;".

Both should work.

Now, to understand why : have a look there http://nginx.org/en/docs/http/request_processing.html

A.

From: Aditya Herlambang <aditya15417@hotmail.com>
To: nginx@nginx.org
Sent: Tue, March 1, 2011 6:08:53 AM
Subject: problem with virtual host settings




So I have a info.php page which is located on the folder /var/www/nginx-default, however when I go to my ip address/info.php, it always redirects me to this site:

http://www.iana.org/domains/example/

is this because I have a virtual host that I called example? Here is my config for the example website:


server {
listen 80;
server_name www.example.com;
rewrite ^/(.*) http://example.com/$1 permanent;
}

server {
listen 80;
server_name example.com;

access_log /var/www/example.com/logs/access.log;
error_log /var/www/example.com/logs/error.log;

location / {
root /var/www/example.com/public/;
index index.html;
}
}


As I don't have a domain name yet and I can only access the server via terminal. The way I access this site via browser is by changing my /etc/hosts in my macbook so that example.com is mapped to my server IP address. however now when I do xxx.xxx.xxx.xxx/info.php in my macbook browser it redirects me to that site I posted above, when I access example.com from my macbook it works just fine.


Catch ALL requests by LUA-script

Hi,

i'm using the nginx-lua-module by agentzh on the current stable nginx
(0.8.54) (also the drizzle and echo module and php via php-fpm)

it's working fine with a plain nginx running

What i would like to to:
Is it possible to create a location-entry in the nginx.conf that ALL
requests coming to the Server are handled by a LUA-script?

i.e. i have set the *.php and / locations to internal so only the lua
script should have access to the files (it's responsible for the in- and
output)

i created another "location * { }" ... which contains
"rewrite_by_lua_file /path/to/the/script" and for testing purposes
"default_type 'text/html'"

But now, every request to the Server ends with a 404.

Background: I would like to have a LUA-script which handles every
request and filters certain Headers, Parameters, etc.

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


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

Why NGX_SOCKADDRLEN is 512?

For an IPv6, sizeof (struct sockaddr_in6) is only 28bytes, so why set
NGX_SOCKADDRLEN 512?

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


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

Re: Implementation of parsing URL to IPv6

On Mon, Feb 28, 2011 at 09:44:24PM -0500, speedfirst wrote:
> never try to use a mail list before. I try to send the diff to
> nginx-devel@nginx.org through email. Is that OK? sorry this is naive.

Please send the patch in "diff -u" format.
The default diff format is intended for aliens.


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

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

Re: Implementation of parsing URL to IPv6

On Mon, Feb 28, 2011 at 09:57:21PM -0500, speedfirst wrote:
> what I mean is, in Web, nginx-devel@ is readonly. And after I send mail,
> my message doesn't show in the list. Is it alright?

To write in the list you have to subscribe to.
Now I have added your two addresses in the write only mode.


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

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

problem with virtual host settings




So I have a info.php page which is located on the folder /var/www/nginx-default, however when I go to my ip address/info.php, it always redirects me to this site:

http://www.iana.org/domains/example/

is this because I have a virtual host that I called example? Here is my config for the example website:


server {      listen   80;      server_name  www.example.com;      rewrite ^/(.*) http://example.com/$1 permanent;      }  server {      listen   80;      server_name example.com;       access_log /var/www/example.com/logs/access.log;      error_log /var/www/example.com/logs/error.log;       location / {           root   /var/www/example.com/public/;           index  index.html;           } } 


As I don't have a domain name yet and I can only access the server via terminal. The way I access this site via browser is by changing my /etc/hosts in my macbook so that example.com is mapped to my server IP address. however now when I do xxx.xxx.xxx.xxx/info.php in my macbook browser it redirects me to that site I posted above, when I access example.com from my macbook it works just fine.

Re: Implementation of parsing URL to IPv6

what I mean is, in Web, nginx-devel@ is readonly. And after I send mail,
my message doesn't show in the list. Is it alright?

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


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

Re: Implementation of parsing URL to IPv6

never try to use a mail list before. I try to send the diff to
nginx-devel@nginx.org through email. Is that OK? sorry this is naive.

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


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

Scalability - using nginx with up to 300k comet connections

Hi all,

I saw on the nginx faq that "10,000 inactive HTTP keep-alive connections
take about 2.5M memory"
Sounds incredibly good! I was wondering if nginx would scale to 300k
comet connections on a single server. From the faq entry, it sounds like
that would require 75 megs of memory, which sounds like it'd be barely
raising a sweat.
Our application involves holding open comet connections to about 300k
clients, at very low per-connection messaging rates, using NHPM
(pushmodule.slact.net) or whatever is the best way to use nginx with
comet.

Would nginx be ideal for this?
Thanks so much

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


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

Re: Time-of-day caching?

On 28 Fev 2011 19h53 WET, nginx-forum@nginx.us wrote:

> Quick note of intro: I'm certainly not a highly-experienced sys
> admin or developer -- more of a "gifted amateur" as a friend once
> called me :) Anyway:
>
> I have a large and fairly complex WordPress-based site that's become
> a lot more popular than expected, and is often close to maxing out
> my hardware. My challenge in optimizing the site is that all of the
> most popular pages/files are very time-sensitive -- they're updated
> at specific times of day, and are very heavily downloaded as soon as
> they're available. So: I need those pages/files to be flushed from
> the cache the moment they change, while everything else is cached
> more aggressively.

I'm not much of a WP guy, mostly Drupal ;), but I think that this WP
plugin can be of assistance in your quest:

http://wordpress.org/extend/plugins/nginx-proxy-cache-purge/

You need to install the cache purge 3rd party module:

https://github.com/FRiCKLE/ngx_cache_purge/

Note that this is a route that voids solutions like SuperCache. It's
more complex to setup, but ultimately much more flexible.

> I haven't found a good solution for this with WordPress plug-ins
> such as SuperCache -- they seem to be too "all-or-nothing", flushing
> too much or too little.
>
> I've been tinkering with Nginx as a reverse proxy sitting in front
> of Apache. I'm getting very good results so far with regular
> caching, but I don't see a way to get that "time-based cache
> granularity" I need. But as I say, I'm no expert.
>
> Any thoughts? Thanks.

Since you're already using Nginx as a reverse proxy is a "natural"
fit.

No need to use Varnish.

My $.02
--- appa


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

post_action vs error_page seems doesn't work [maxf3r]

hi,
what I want to do is:

1) trying to serve content like url => http://my.domain.tld/static/bla-bla-bla?id=12345 
2) check an html page on cache (on redis)
3) if doesn't exists, let's create it (via php script /api/entrypoint.php?...  )
4) always update statistical counters  (asyncronous batch)

problem:
step 4) never processed until I comment "error page 404 = ...".
In thi case all request to redis are processed (via 127.0.0.1:33333 and 127.0.0.1:22222) but a 404 error on browser too :(


my nginx.conf


location ^~ /static/  {

  # 2) check an html page (on redis)
  set $redis_key  "my:permalink:$arg_id:html";
  redis_pass  127.0.0.1:33333;

  # 3) if doesn't exists, let's create it (via php)
  error_page  404 = /api/entrypoint.php?action=do_html&id=$arg_id;

  # 4) always update statistical counters  (asyncronous batch)
  post_action /update_counters;
}

location /update_counters {

  set $queue_name 'my:queue:to:process:asyncronous';
  redis2_query lpush $queue_name $request_uri;
  redis2_pass 127.0.0.1:22222;

}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {

  root           html;
  fastcgi_pass   127.0.0.1:9000;
  fastcgi_index  index.php;
  fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
  include        fastcgi_params;

}


thanks
maxf3r

--

.. happiness only real when shared [supertramp]


Re: Time-of-day caching?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/28/2011 04:53 PM, Brent wrote:
> So: I need those pages/files to be flushed from the
> cache the moment they change, while everything else is cached more
> aggressively.
>

You can do this with Expires header.

> I haven't found a good solution for this with WordPress plug-ins such as
> SuperCache -- they seem to be too "all-or-nothing", flushing too much or
> too little.
>

SuperCache will create static files from your dynamic pages or "posts"
and everything else is configured by Expires.

I'm not nginx guru, but I've this setup:

- - Varnish as cache
- - nginx as webserver with spawn-fcgi

* "static files generated by SuperCache": posts.html with 10 minuts of
Expires
* static files: images, js and everything else with 'max'

http://pastebin.com/jfy9GgkN

Hope this helps.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1sBkkACgkQNRQApncg297GMQCgkd6DScym6Q2EXipM1+rg18Sd
9u0An1NqXlXsKdg+tZcytMZzqMUOfnXF
=hdPD
-----END PGP SIGNATURE-----


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

Time-of-day caching?

Quick note of intro: I'm certainly not a highly-experienced sys admin or
developer -- more of a "gifted amateur" as a friend once called me :)
Anyway:

I have a large and fairly complex WordPress-based site that's become a
lot more popular than expected, and is often close to maxing out my
hardware. My challenge in optimizing the site is that all of the most
popular pages/files are very time-sensitive -- they're updated at
specific times of day, and are very heavily downloaded as soon as
they're available. So: I need those pages/files to be flushed from the
cache the moment they change, while everything else is cached more
aggressively.

I haven't found a good solution for this with WordPress plug-ins such as
SuperCache -- they seem to be too "all-or-nothing", flushing too much or
too little.

I've been tinkering with Nginx as a reverse proxy sitting in front of
Apache. I'm getting very good results so far with regular caching, but I
don't see a way to get that "time-based cache granularity" I need. But
as I say, I'm no expert.

Any thoughts? Thanks.

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


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

Re: upload issue when NGINX actes as reverse proxy

On Sun, Feb 27, 2011 at 8:30 AM, Web George <webgreatwall@gmail.com> wrote:
> Do you mean that it is the configuration issue because of backend server ?
> I set the "buffing off".
>
>
> 2011/2/25 Mark Moseley <moseleymark@gmail.com>
>>
>> On Fri, Feb 25, 2011 at 9:56 AM, Valery Kholodkov
>> <valery+nginxen@grid.net.ru> wrote:
>> > Web George wrote:
>> >>
>> >> thanks for your info.
>> >>
>> >> Can NGINX bypass and sent it directly to backend ?
>> >
>> > It can, but without streaming (with buffering), which is now what you
>> > want
>> > as we have already figured out.
>> >
>> >>
>> >> thanks
>> >> George
>> >>
>> >> 2011/2/25 Valery Kholodkov <valery+nginxen@grid.net.ru
>> >> <mailto:valery%2Bnginxen@grid.net.ru>>
>> >>
>> >>
>> >>    ----- Valery Kholodkov <valery+nginxen@grid.net.ru
>> >>    <mailto:valery%2Bnginxen@grid.net.ru>> wrote:
>> >>     >
>> >>     > ----- Web George <webgreatwall@gmail.com
>> >>    <mailto:webgreatwall@gmail.com>> wrote:
>> >>     > > Thanks Weibin's feedback.
>> >>     > >
>> >>     > > I searched a mail with the same issue.
>> >>     > >  ref:  http://forum.nginx.org/read.php?2,5506,146254
>> >>     > >
>> >>     > > >From the update of Igor, it should be an issue and would be
>> >>    developed.
>> >>     > >
>> >>     > > We do not know the latest status...
>> >>     > >
>> >>     > > It seems that UPLOAD module can not solve the issue.
>> >>     >
>> >>     > No, it doesn't seem so. upload module is especially designed for
>> >>    solving this issue.
>> >>
>> >>    Correction: yes, you are right and I am wrong, as long as you are
>> >>    talking about streaming uploads to the backend.
>> >>
>> >>    However, if you want to stream the entire request body without
>> >>    modifications, why don't you make clients send requests directly to
>> >>    the backend?
>> >>
>> >>    --
>> >>    Regards,
>> >>    Valery Kholodkov
>> >>
>> >>    _______________________________________________
>> >>    nginx mailing list
>> >>    nginx@nginx.org <mailto:nginx@nginx.org>
>> >>    http://nginx.org/mailman/listinfo/nginx
>>
>> When I've run into this type of issue, usually it's due to the backend
>> (Apache in my case) not seeing any activity over the connection that
>> nginx has made with it, while nginx is buffering the upload to a temp
>> file. In that case, it was just a matter of upping Apache's timeout.

In my case, yes. I usually have the upload buffer set to a couple
hundred meg and slower clients wouldn't hit either the end of the
upload or the buffer limit before Apache had timed out the connection
from nginx. If you're not buffering though, then probably not relevant
to your issue.

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

Re: request hangs

r->count--; to the right place fixed my problem.

Thanks agentzh again!

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


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

Re: nginx.conf questions

Just skip the "server_name example.com;" bit.

You don't need the rewrite server for IP address based server.

server {
listen 80;
root /path/to/your/document/root/;

access_log /path/to/where/you/want/to/keep/your/access.log;
error_log //path/to/where/you/want/to/keep/your/error.log;

location /example/ {
index index.html;
....
}

location / {
index index.html;
....
}

}

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


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

Re: LNMP installer

For Ubuntu: https://github.com/vladgh/VladGh.com-LEMP (you can edit it
before you run the installer and set the version of nginx you want).

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


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

Re: Implementation of parsing URL to IPv6

Hello!

On Mon, Feb 28, 2011 at 06:39:00AM -0500, speedfirst wrote:

> Hey, guys. I've implement a parse URL to IPv6 function which is
> discussed in "http://forum.nginx.org/read.php?2,177146,177190". I change
> "ngx_parse_url" and add an function "ngx_parse_host" to resolve a host
> (IP or text) to either IPv4 or IPv6 functions. And I change
> "ngx_inet_resolve_host" to let it accept IPv4/IPv6. Besides I add
> another function "ngx_inet_sock_addr" to parse string with format
> "ipv4:port" and "[ipv6]:port" to the addr structure. Seems I can't
> upload the attachment so I past them here. I've do the unit test to
> them. Hope you can take regression test and merge them to the nginx main
> branch.
>
> If u wish, I can also past the unit test I write. (I think send via
> email would be more convenient)

1. Please use nginx-devel@ mailing list instead.

2. Please post diffs in unified format, not chunks of code.

Maxim Dounin

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

Implementation of parsing URL to IPv6

Hey, guys. I've implement a parse URL to IPv6 function which is
discussed in "http://forum.nginx.org/read.php?2,177146,177190". I change
"ngx_parse_url" and add an function "ngx_parse_host" to resolve a host
(IP or text) to either IPv4 or IPv6 functions. And I change
"ngx_inet_resolve_host" to let it accept IPv4/IPv6. Besides I add
another function "ngx_inet_sock_addr" to parse string with format
"ipv4:port" and "[ipv6]:port" to the addr structure. Seems I can't
upload the attachment so I past them here. I've do the unit test to
them. Hope you can take regression test and merge them to the nginx main
branch.

If u wish, I can also past the unit test I write. (I think send via
email would be more convenient)

ngx_int_t
ngx_inet_sock_addr (u_char * p, size_t len, struct sockaddr * sockaddr)
{
u_char *port, *last;
ngx_int_t n;
struct sockaddr_in *sin;

#if (NGX_HAVE_INET6)
struct sockaddr_in6 *sin6;
u_char *q;

Re: FastCGI PHP No input file specified.

Thank you.

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


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

Does the nginx support "Header append ..."?

For Apache Httpd the "Header" directive can "append" a value to the
exsisting headers of the same name.

e.g.

Before: Vary: Host

Header append Vary User-Agent

After: Vary: Host, User-Agent


But for Nginx, neither "add_header" nor "more_set_headers" directive can
"append" a value to an exsisting headers.

Especially, the "more_set_headers" will create a duplicate headers of
the same name. i.e.

Vary: Host
Vary: User-Agent

So, What's the reason for it? How should I do for the "append"?

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


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

Re: request hangs

agentzh Wrote:
-------------------------------------------------------
> On Mon, Feb 28, 2011 at 2:33 PM, magz wrote:
> > magz Wrote:
> >
> --------------------------------------------------
> -----
> >> Hi,
> >>
> >> I have strange problem with main request  hand
> if
> >> I call for sub-request.  Maybe somebody can
> help
> >> me with it?
> >>
>
> Which version of nginx are you using?
>
> If you're using nginx 0.8.x and above, the symptom
> suggests you didn't
> get r->main->count right. Use --with-debug while
> building your nginx,
> and track the values of r->main->count.
>
> For example, in the following line of my local
> error.log,
>
> 2011/01/28 13:01:50 1199#0: *1 http finalize
> request: -4,
> "/main?" a:0, c:3
>
> a:0 means the current request is not the active
> request at the moment
> (i.e., r != r->connection->data), and c:3 means
> r->main->count is 3.
> The request can only be successfully finalized
> unless it is the
> current active request. Also, the main request
> won't terminate, i.e.,
> will hang if the r->main->count counter is not
> going to be decremented
> to zero. Well, r->main->count is just a reference
> counter for the main
> request object. A simple way of doing poors'
> "garbage collection",
> well, at least kind of.
>
> When doing subrequest programming on the C level,
> one should be VERY
> VERY careful with these two values, among other
> things :)
>
> Cheers,
> -agentzh
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx


Thanks for the hint agentzh! Will try to dig in that area.

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


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

2011年2月27日星期日

Re: Lua headers

On Sun, Feb 27, 2011 at 7:23 AM, Richard Kearsley
<Richard.Kearsley@m247.com> wrote:
> Hi

Sorry for the delay. I've been on holiday in the next few days :P

> Is it possible to set the headers of a lua request to my auth server?

Yes, use the ngx_headers_more module's more_set_input_headers
directive or ngx_proxy module's proxy_set_header directive in your
auth server's proxy location.

http://wiki.nginx.org/NginxHttpProxyModule#proxy_set_header

> I can set the querystring/args as shown in a few examples but never seen
> headers being set in lua?
>

BTW, by default, the main request's headers will be forwarded to your
subrequest destination locations. If that's not what you want, use the
proxy_pass_request_headers directive to disable that:

http://wiki.nginx.org/NginxHttpProxyModule#proxy_pass_request_headers

For now, setting subrequest headers from within Lua is not implemented
yet in ngx_lua. But it's on our TODO list :)

Cheers,
-agentzh

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

Re: request hangs

On Mon, Feb 28, 2011 at 2:33 PM, magz <nginx-forum@nginx.us> wrote:
> magz Wrote:
> -------------------------------------------------------
>> Hi,
>>
>> I have strange problem with main request  hand if
>> I call for sub-request.  Maybe somebody can help
>> me with it?
>>

Which version of nginx are you using?

If you're using nginx 0.8.x and above, the symptom suggests you didn't
get r->main->count right. Use --with-debug while building your nginx,
and track the values of r->main->count.

For example, in the following line of my local error.log,

2011/01/28 13:01:50 [debug] 1199#0: *1 http finalize request: -4,
"/main?" a:0, c:3

a:0 means the current request is not the active request at the moment
(i.e., r != r->connection->data), and c:3 means r->main->count is 3.
The request can only be successfully finalized unless it is the
current active request. Also, the main request won't terminate, i.e.,
will hang if the r->main->count counter is not going to be decremented
to zero. Well, r->main->count is just a reference counter for the main
request object. A simple way of doing poors' "garbage collection",
well, at least kind of.

When doing subrequest programming on the C level, one should be VERY
VERY careful with these two values, among other things :)

Cheers,
-agentzh

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

Re: request hangs

magz Wrote:
-------------------------------------------------------
> Hi,
>
> I have strange problem with main request hand if
> I call for sub-request. Maybe somebody can help
> me with it?
>
> I do spam filtering in post request. So I added
> location to nginx.conf and call sub-request for
> that location. Then read output from sub-request
> and set up nginx variable according to output.
>
> So config looks like:
> location = /checkspam {
> internal;
> include spam_fastcgi.conf;
> }
>
>
> SOURCE code is here:
> http://codepaste.net/17tfmu
>
> From client side it looks like client can not
> receive last chank of original request (last 10-50
> bytes). And it's not easy to understand what is
> going on. Any advises are welcome.
>
> I put debug log here:
> http://codepaste.net/ceiian
>
> Thanks,
> Max.


Silence here means that question was not clear or nobody knows the
answer. I will try to ask my question in another way. If you know the
answer please respond to me.

I do:
1. register handler in REWRITE_PHASE
h = ngx_array_push(&cmcf->phases[NGX_HTTP_REWRITE_PHASE].handlers);
*h = ngx_http_form_input_handler;

2. In ngx_http_form_input_handler() read POST body and act the
handler:
r->request_body_in_single_buf = 1;
rc = ngx_http_read_client_request_body(r,
ngx_http_form_input_post_read);

3. In ngx_http_form_input_post_read() call subsequent with POST body to
different location
psr->handler = ngx_http_form_input_post_subrequest_handler;
rc = ngx_http_subrequest(r, &uri, &args, &sr, psr, 0);


Now the question is why original request hands on returning last buffer
chank to client?

It looks like client holds on read() forever. If kill signal is sent to
nginx client receives this last buffer. Also sub-request works fine
(send all POST data from client and receives what is should receive).
Without sub-request everything works fine too.

Is it know nginx issue?

What workaround can be applied here? Maybe create create additional
filter and terminate request? Or adjust request buffers after
sub-request is done?

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


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

nginx.conf questions

I was following the tutorial here. It says

This will create the virtual host file for Nginx in the sites-available directory. Simply paste the following into the file and change each instance of "example.com" to your site's domain name:


server {      listen   80;      server_name  www.example.com;      rewrite ^/(.*) http://example.com/$1 permanent;      }  server {      listen   80;      server_name example.com;       access_log /var/www/example.com/logs/access.log;      error_log /var/www/example.com/logs/error.log;       location / {           root   /var/www/example.com/public/;           index  index.html;           } } 

The problem is that I don't have a domain name, I have an ip address... so what should I change example.com to? I tried changing it to my ip address, but it doesn't work



However, I don't have a domain name... I have an IP... what if I want to make this as a subdomain, say xxx.xxx.xxx.xxx/example
How can I do that?

Re: LNMP installer

Wendal Chen at 2011-2-28 9:41 wrote:
> http://lnmp.org/download.html
>
I think your site should be translated Chinese into English. This is an
international email list.
> 2011/2/28 Aditya Herlambang <aditya15417@hotmail.com
> <mailto:aditya15417@hotmail.com>>
>
>
> Does anyone know any good LNMP installer that install everything
> up to date with the current version?
> PHP 5.3, Nginx 0.8, etc..etc
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org <mailto:nginx@nginx.org>
> http://nginx.org/mailman/listinfo/nginx
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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: LNMP installer

http://lnmp.org/download.html

2011/2/28 Aditya Herlambang <aditya15417@hotmail.com>

Does anyone know any good LNMP installer that install everything up to date with the current version?
PHP 5.3, Nginx 0.8, etc..etc

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


Re: error log and session in PHP

On 2/28/2011 2:05 AM, Aditya Herlambang wrote:
I am getting the following error log:

PHP Warning:  Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0" while reading upstream, client: 70.176.18.156, server: localhost, request: "POST /phpMyAdmin/setup/index.php?page=form&formset=main_frame HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "50.56.81.42", referrer: "http://50.56.81.42/phpMyAdmin/setup/index.php?page=form&formset=main_frame"
2011/02/27 16:19:03 [error] 22892#0: *56 FastCGI sent in stderr: "PHP Warning:  Unknown: open(/var/lib/php/session/sess_1om2jb4klr65bfotepo0j7214cvrj2b2, O_RDWR) failed: Permission denied (13) in Unknown on line 0

How can I fix this??
 
_______________________________________________ nginx mailing list nginx@nginx.org http://nginx.org/mailman/listinfo/nginx

Hello,

The permission of /var/lib/php/session folder should be drwx-wx-wt  and owner is root, user is root.

You need to change it.

LNMP installer


Does anyone know any good LNMP installer that install everything up to date with the current version?
PHP 5.3, Nginx 0.8, etc..etc

Re: nginx serving the wrong url?

On Mon, Feb 28, 2011 at 12:43:29PM +1300, Ryan B wrote:

Hi there,

> I'm not sure what exactly
> "/var/www/https:/secure.domain.com/index.html" is (should be
> /var/www/index.html) How can I correct this?

Find the Referer: page, the place where these clients found this link,
and change it to point to

https://secure.domain.com/

instead of

/https://secure.domain.com/

> request: "HEAD /https://secure.domain.com/
> HTTP/1.1", host: "secure.domain.com"

That is the request that is being received.

Good luck,

f
--
Francis Daly francis@daoine.org

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

nginx serving the wrong url?

I'm not sure what exactly
"/var/www/https:/secure.domain.com/index.html" is (should be
/var/www/index.html) How can I correct this?


2011/01/28 17:20:05 [error] 15415#0: *1117703
"/var/www/https:/secure.domain.com/index.html" is not found (2: No
such file or directory), client: 119.110.28.211, server:
secure.domain.com, request: "HEAD /https://secure.domain.com/
HTTP/1.1
", host: "secure.domain.com"
2011/01/28 17:26:44 [error] 15413#0: *1119352
"/var/www/https:/secure.domain.com/index.html" is not found (2: No
such file or directory), client: 89.119.24.23, server:
secure.domain.com, request: "HEAD /https://secure.domain.com/
HTTP/1.1
", host: "secure.domain.com"
2011/01/28 18:26:12 [error] 15415#0: *1134480
"/var/www/https:/secure.domain.com/index.html" is not found (2: No
such file or directory), client: 70.41.141.44, server:
secure.domain.com, request: "HEAD /https://secure.domain.com/
HTTP/1.1
", host: "secure.domain.com"

server {
server_name secure.domain.com;
listen 443;
listen [::]:443 default ipv6only=on;
gzip on;
gzip_comp_level 1;
#gzip_buffers 32 128k;

gzip_types text/plain text/html text/css
application/x-javascript text/xml text/javascript;
# GZIP module, stops the cpu usage for compressing the files
all the time time.
error_log logs/ssl.error.log;
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;
#ssl_prefer_server_ciphers on;
#keepalive_requests 280;
#keepalive_timeout 5;
#ssl_session_cache shared:SSL:10m;
#ssl_session_timeout 1m;
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;
}
}

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

error log and session in PHP

I am getting the following error log:

PHP Warning:  Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0" while reading upstream, client: 70.176.18.156, server: localhost, request: "POST /phpMyAdmin/setup/index.php?page=form&formset=main_frame HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "50.56.81.42", referrer: "http://50.56.81.42/phpMyAdmin/setup/index.php?page=form&formset=main_frame"
2011/02/27 16:19:03 [error] 22892#0: *56 FastCGI sent in stderr: "PHP Warning:  Unknown: open(/var/lib/php/session/sess_1om2jb4klr65bfotepo0j7214cvrj2b2, O_RDWR) failed: Permission denied (13) in Unknown on line 0

How can I fix this??

Re: Passing variables to access_log, error_log names

Jim Ohlstein Wrote:
-------------------------------------------------------
> --
> Jim Ohlstein
> On Feb 27, 2011 11:28 AM, "Dayo" wrote:
> >
> > Maxim Dounin Wrote:
> >
> --------------------------------------------------
> -----
> > > > server {
> > > > listen 80;
> > > > server_name
> ~^(www\.)?(?P[^.]+).mydomain.com$;
> > >
> > > Just a side note: forum is still eating data
> > > (originally
> > > "P" was here), you may want to consider using
> > > mailing
> > > list directly instead.
> >
> > Unfortunately, the mailing list is not as user
> friendly for me as the
> > forum.
> >
> > I note that the forum module being used has the
> option to strip HTML and
> > BB Code tags which must be activated.
>
> Perhaps you should read and search and you will
> see that this discussion was
> had in the past and again recently. Stripping
> bbcode tags strips everything
> between square brackets. This is worse. Can you
> show me where HTML is *not*
> stripped?
Sorry. I wasn't clear. I was just trying to explain to Maxim that the
stripping bit must be on which is why the data gets eaten as he puts
it.
Perhaps the code can be adjusted or switched off.
>
> I've offered to turn it over to anyone who thinks
> that he or she can do it
> better. Care to take me up? If not then stop
> sniping. If yes, get Igor's
> approval and I'll package up the database and
> files for you.
No need to throw your toys out of the pram.
I am not sniping and will like to work with you to getting this setup
even better as I know it must be a bit of a hassle.
>
> >
> > I wonder if the forum admin would consider
> switching it off.
> >
> > I also wonder if he will get round to looking at
> my suggestion for
> > dealing with the problem with the preview
> setting which disrupts
> > navigating the forum.
>
> I wonder when you'll stop whining about it.
Touchy, touchy aren't we?
Take a deep breath.

I can't see why you are so adamant that you will not offer an option to
switch it off.
Surely the best of both worlds were those that want it, have it ,and
those that don't want it don't can't be a bad thing ... can it?

I am happy to help out if you are happy to allow.

I repeat. I am not sniping and there are no monsters under the bed.

I applaud your efforts here and want to see it become an even bigger
success.

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


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

Re: Passing variables to access_log, error_log names

On 27 Fev 2011 08h17 WET, igor@sysoev.ru wrote:


>> I just tried:
>>
>> set $test foo;
>> access_log /var/log/nginx/$test.domain_access.log;
>> error_log /var/log/nginx/domain_error.log;
>>
>> And no access log entry is registered whatsoever. I'm using 0.9.4.
>>
>> Can you elaborate on your 'Variables in access_log should work'?
>> Do you mean it should work in a dirname and not on a filename?
>> E.g.:
>>
>> access_log /var/log/nginx/$test/domain_access.log;
>
> nginx workers must have rights to create files in /var/log/nginx.

They have. If I set:

access_log /var/log/nginx/foo.domain_access.log;
error_log /var/log/nginx/domain_error.log;

a new access log file is created. It just happens that with the above
setting of $set foo no foo.domain_access.log file is created.

--- appa

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

Re: Passing variables to access_log, error_log names

--
Jim Ohlstein
On Feb 27, 2011 11:28 AM, "Dayo" <nginx-forum@nginx.us> wrote:
>
> Maxim Dounin Wrote:
> -------------------------------------------------------
> > > server {
> > >   listen 80;
> > >   server_name ~^(www\.)?(?P[^.]+).mydomain.com$;
> >
> > Just a side note: forum is still eating data
> > (originally
> > "P" was here), you may want to consider using
> > mailing
> > list directly instead.
>
> Unfortunately, the mailing list is not as user friendly for me as the
> forum.
>
> I note that the forum module being used has the option to strip HTML and
> BB Code tags which must be activated.

Perhaps you should read and search and you will see that this discussion was had in the past and again recently. Stripping bbcode tags strips everything between square brackets. This is worse. Can you show me where HTML is *not* stripped?

I've offered to turn it over to anyone who thinks that he or she can do it better. Care to take me up? If not then stop sniping. If yes, get Igor's approval and I'll package up the database and files for you.

>
> I wonder if the forum admin would consider switching it off.
>
> I also wonder if he will get round to looking at my suggestion for
> dealing with the problem with the preview setting which disrupts
> navigating the forum.

I wonder when you'll stop whining about it.

See above

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

--
Jim Ohlstein

Re: upload issue when NGINX actes as reverse proxy

Do you mean that it is the configuration issue because of backend server ?
I set the "buffing off".


2011/2/25 Mark Moseley <moseleymark@gmail.com>
On Fri, Feb 25, 2011 at 9:56 AM, Valery Kholodkov
<valery+nginxen@grid.net.ru> wrote:
> Web George wrote:
>>
>> thanks for your info.
>>
>> Can NGINX bypass and sent it directly to backend ?
>
> It can, but without streaming (with buffering), which is now what you want
> as we have already figured out.
>
>>
>> thanks
>> George
>>
>> 2011/2/25 Valery Kholodkov <valery+nginxen@grid.net.ru
>> <mailto:valery%2Bnginxen@grid.net.ru>>
>>
>>
>>    ----- Valery Kholodkov <valery+nginxen@grid.net.ru
>>    <mailto:valery%2Bnginxen@grid.net.ru>> wrote:
>>     >
>>     > ----- Web George <webgreatwall@gmail.com
>>    <mailto:webgreatwall@gmail.com>> wrote:
>>     > > Thanks Weibin's feedback.
>>     > >
>>     > > I searched a mail with the same issue.
>>     > >  ref:  http://forum.nginx.org/read.php?2,5506,146254
>>     > >
>>     > > >From the update of Igor, it should be an issue and would be
>>    developed.
>>     > >
>>     > > We do not know the latest status...
>>     > >
>>     > > It seems that UPLOAD module can not solve the issue.
>>     >
>>     > No, it doesn't seem so. upload module is especially designed for
>>    solving this issue.
>>
>>    Correction: yes, you are right and I am wrong, as long as you are
>>    talking about streaming uploads to the backend.
>>
>>    However, if you want to stream the entire request body without
>>    modifications, why don't you make clients send requests directly to
>>    the backend?
>>
>>    --
>>    Regards,
>>    Valery Kholodkov
>>
>>    _______________________________________________
>>    nginx mailing list
>>    nginx@nginx.org <mailto:nginx@nginx.org>
>>    http://nginx.org/mailman/listinfo/nginx

When I've run into this type of issue, usually it's due to the backend
(Apache in my case) not seeing any activity over the connection that
nginx has made with it, while nginx is buffering the upload to a temp
file. In that case, it was just a matter of upping Apache's timeout.

_______________________________________________
nginx mailing list
nginx@nginx.org

Re: Passing variables to access_log, error_log names

Maxim Dounin Wrote:
-------------------------------------------------------
> > server {
> > listen 80;
> > server_name ~^(www\.)?(?P[^.]+).mydomain.com$;
>
> Just a side note: forum is still eating data
> (originally
> "P" was here), you may want to consider using
> mailing
> list directly instead.

Unfortunately, the mailing list is not as user friendly for me as the
forum.

I note that the forum module being used has the option to strip HTML and
BB Code tags which must be activated.

I wonder if the forum admin would consider switching it off.

I also wonder if he will get round to looking at my suggestion for
dealing with the problem with the preview setting which disrupts
navigating the forum.

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


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

Re: Error in nginx_http_push_module: unable to allocate message, worker subscriber queue marker in shared memory

nginx_http_push_module exists some bugs now.

The author uses a global pool to allocate small memory, while free it when use up. As we known,Nginx won't free small memory until we destory it. So it leads to memory leaks.

see:http://blog.lifeibo.com for more informations.

lizi

at 2011-2-25,14:09,"zeeshan.m.malik" <nginx-forum@nginx.us> :

Hi,
I am using nginx_http_push_module for  a web service which provides real
time visitors stats for websites using our service. The service works
fine for couple of days but after that it stops responding and leaves
errors like following in error.log for each subscriber or publisher
request.

    2011/02/21 04:00:55 [crit] 18800#0: ngx_slab_alloc() failed: no
memory
    2011/02/21 04:00:55 [crit] 18800#0: ngx_slab_alloc() failed: no
memory
    2011/02/21 04:00:55 [error] 18800#0: *2812675 push module: unable
to allocate message in shared memory, client: 127.0.0.1, server:
async-presence.bumpin.com, request: "POST
/publish?id=a837a96c06a029d36c1503d9c450c79a HTTP/1.1", host:
"async-presence.bumpin.com"
    2011/02/21 04:00:58 [crit] 18798#0: ngx_slab_alloc() failed: no
memory
    2011/02/21 04:00:58 [crit] 18798#0: ngx_slab_alloc() failed: no
memory
    2011/02/21 04:00:58 [error] 18798#0: *2812340 push module: unable
to allocate worker subscriber queue marker in shared memory, client:
213.58.208.210, server: async-presence.bumpin.com, request: "GET
/activity?id=870897807857a92dcdfdadf3721aba71&_1298288754326= HTTP/1.1",
host: "async-presence.bumpin.com", referrer:
"http://www.keepersofmetal.net/search/label/Visions%20of%20Atlantis"
    2011/02/21 04:00:59 [crit] 18799#0: ngx_slab_alloc() failed: no
memory
    2011/02/21 04:00:59 [crit] 18799#0: ngx_slab_alloc() failed: no
memory
    2011/02/21 04:00:59 [error] 18799#0: *2812817 push module: unable
to allocate message in shared memory, client: 127.0.0.1, server:
async-presence.bumpin.com, request: "POST
/publish?id=d1637e1f2fedb569c1350a6ccd6d79e2 HTTP/1.1", host:
"async-presence.bumpin.com"
    2011/02/21 04:00:59 [crit] 18798#0: ngx_slab_alloc() failed: no
memory
    2011/02/21 04:00:59 [crit] 18798#0: ngx_slab_alloc() failed: no
memory
    2011/02/21 04:00:59 [error] 18798#0: *2812828 push module: unable
to allocate message in shared memory, client: 127.0.0.1, server:
async-presence.bumpin.com, request: "POST
/publish?id=f6d0850613e92edeacf3b7596aa304b3 HTTP/1.1", host:
"async-presence.bumpin.com"
    2011/02/21 04:01:00 [crit] 18798#0: ngx_slab_alloc() failed: no
memory
    2011/02/21 04:01:00 [crit] 18798#0: ngx_slab_alloc() failed: no
memory


And even when it is working it generates lots of errors
    2011/02/22 03:42:58 [alert] 4665#0: ngx_slab_free(): chunk is
already free

Following are my push configurations:


       location /publish {
         set $push_channel_id $arg_id; #/?id=239aff3 or somesuch
         push_publisher;

         push_store_messages off; # enable message queueing
       }

       # public long-polling endpoint
       location /activity {
         push_subscriber;

         push_subscriber_concurrency broadcast;
         set $push_channel_id $arg_id;
         default_type text/plain;
         send_timeout 3600;
       }


And here is the output of command nginx -V
    nginx version: nginx/0.8.54
    built by gcc 4.3.3 (Ubuntu 4.3.3-5ubuntu4)
    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 --with-http_dav_module
--http-client-body-temp-path=/var/lib/nginx/body --with-http_ssl_module
--http-proxy-temp-path=/var/lib/nginx/proxy
--with-http_stub_status_module
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug
--with-http_flv_module --add-module=/opt/nginx_http_push_module-0.692

Is this behavior due to some bug in the push module or is there
something wrong with my server configurations.

Thanks,
Zeeshan

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


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

Re: nginx can't read images

On Feb 27, 2011, at 18:35 , Aditya Herlambang wrote:

Is it also possible to change my php directive to:

 location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  html$fastcgi_script_name;
           include        fastcgi_params;
        }

?? Will it do the same?

Please read this

RE: nginx can't read images

Is it also possible to change my php directive to:

 location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  html$fastcgi_script_name;
           include        fastcgi_params;
        }

?? Will it do the same?





> Date: Sun, 27 Feb 2011 12:50:35 +0000
> From: francis@daoine.org
> To: nginx@nginx.org
> Subject: Re: nginx can't read images
>
> On Sun, Feb 27, 2011 at 04:47:00AM +0000, Aditya Herlambang wrote:
>
> Hi there,
>
> > So it seems that mginx can't read a url with .png, for example
>
> nginx usually does exactly what you tell it to. In this case...
>
> > http://20.16.31.42/phpMyAdmin/themes/original/img/logo_right.png
> > that gives me a page not found. The ip address above has been changed (not the original one), it'sjust to give illustration. I checked that the file logo_right.png is in fact in that folder. What do I need to do to solve this?
>
> ...what folder is the file logo_right.png in?
>
> Your config tells nginx to look for
>
> /usr/local/nginx/html/phpMyAdmin/themes/original/img/logo_right.png
>
> but your config also suggests that you wanted to tell nginx to look for
>
> /usr/share/nginx/html/phpMyAdmin/themes/original/img/logo_right.png
>
> Each (sub)request in nginx in handled by one location{} block, so you
> must make sure that the correct config is in the location block that is
> used for this specific request. Your location{} for .png urls uses the
> compile-time document root value.
>
> If this server is new, and not used for other files or services, then
> the best change is probably to remove all "root" directives from your
> nginx.conf, and add a single "root /usr/share/nginx/html;" outside all
> location{}s, just after "server_name localhost;"
>
> Otherwise, you should probably add a "location /phpMyAdmin/ {}" which
> contains other location{}s for the new urls you care about.
>
> Note also that the distributed phpMyAdmin includes a few .htaccess files
> to attempt to limit access to some files. There's nothing in your config
> to mimic that, so unless you've taken other steps, you may be exposing
> more that the phpMyAdmin developers consider wise.
>
> Good luck with it,
>
> f
> --
> Francis Daly francis@daoine.org
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx

Re: nginx can't read images

On Sun, Feb 27, 2011 at 04:47:00AM +0000, Aditya Herlambang wrote:

Hi there,

> So it seems that mginx can't read a url with .png, for example

nginx usually does exactly what you tell it to. In this case...

> http://20.16.31.42/phpMyAdmin/themes/original/img/logo_right.png
> that gives me a page not found. The ip address above has been changed (not the original one), it'sjust to give illustration. I checked that the file logo_right.png is in fact in that folder. What do I need to do to solve this?

...what folder is the file logo_right.png in?

Your config tells nginx to look for

/usr/local/nginx/html/phpMyAdmin/themes/original/img/logo_right.png

but your config also suggests that you wanted to tell nginx to look for

/usr/share/nginx/html/phpMyAdmin/themes/original/img/logo_right.png

Each (sub)request in nginx in handled by one location{} block, so you
must make sure that the correct config is in the location block that is
used for this specific request. Your location{} for .png urls uses the
compile-time document root value.

If this server is new, and not used for other files or services, then
the best change is probably to remove all "root" directives from your
nginx.conf, and add a single "root /usr/share/nginx/html;" outside all
location{}s, just after "server_name localhost;"

Otherwise, you should probably add a "location /phpMyAdmin/ {}" which
contains other location{}s for the new urls you care about.

Note also that the distributed phpMyAdmin includes a few .htaccess files
to attempt to limit access to some files. There's nothing in your config
to mimic that, so unless you've taken other steps, you may be exposing
more that the phpMyAdmin developers consider wise.

Good luck with it,

f
--
Francis Daly francis@daoine.org

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

Re: nginx + php 5.3.5 fpm result is high server load

On Sat, 2011-02-26 at 16:52 -0500, izrodix wrote:
> Hi Guys,
> we try to migrate our apache 2.2 mod_fcgid with php-cgi configuration
> to nginx + php-fpm from ports on our freebsd 8.2 stable system.We hosted
> round 200-300 sites.
>
> The result is high load of the server, lots of system calls and
> mysql-server 5.1.55 has doubling his threads.
>
> Any suggestion ?

What's the filesystem format underneath? We've seen some issues recently
with NFS performance if the PHP include path is in the wrong order which
drove the load up to over 200 on a 24-core server with 16G RAM.

We also saw some issues with the maximum memory limits set
in /etc/sysctl.conf which created "false" load in a similar range on the
same box.

HTH,

M.


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

proxy in nginx

Hello, i want to make proxy to my service users that will work as:
User > fast.mydomain
fast.mydomain return to my user file list (autoindex)
user chose file what want download and fast.myhost send him this file
on this track:
fast.mydomain > my proxy server > user

Is possible to configure this on only nginx on two serwers
(fast.mydomain and my proxy server)?

--
Marcin Janowski(WMP)

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

Re: Passing variables to access_log, error_log names

On Feb 27, 2011, at 2:39 , António P. P. Almeida wrote:

> On 26 Fev 2011 23h01 WET, mdounin@mdounin.ru wrote:
>
>> Hello!
>>
>> On Sat, Feb 26, 2011 at 04:49:48PM -0500, ajgon wrote:
>>
>>> Hello,
>>>
>>> I am configuring an automagic virtual hosting on my private
>>> machine, to serve myself projects which I currently work
>>> on. Configuration I'm using is like this:
>>>
>>> server {
>>> listen 80;
>>> server_name ~^(www\.)?(?P[^.]+).mydomain.com$;
>>
>> Just a side note: forum is still eating data (originally
>> "P<project>" was here), you may want to consider using mailing
>> list directly instead.
>>
>>> root /home/ajgon/htdocs/$project;
>>> access_log /var/log/nginx/$project.mydomain.com.access_log main;
>>> error_log /var/log/nginx/$project.mydomain.com.error_log info;
>>> include lang/php;
>>> }
>>>
>>> Everything is working as expected - except one thing. I'm getting
>>> two log files with following names:
>>> /var/log/nginx/$project.mydomain.com.access_log
>>> /var/log/nginx/$project.mydomain.com.error_log for any Vhost.
>>>
>>> Is there any sollution to make nginx parse the variable and set
>>> proper log name?
>>
>> There is no variables support in error_log directive (and it's
>> unlikely to appear), so "...error_log" file is expected. Use
>> common error_log for all vhosts instead.
>>
>> Variables in access_log should work as of 0.7.4+. On the other
>> hand, named captures in regular expressions only supported in
>> 0.8.25+. Are you sure you see "...access_log" file? Which
>> version you are using?
>
> I just tried:
>
> set $test foo;
> access_log /var/log/nginx/$test.domain_access.log;
> error_log /var/log/nginx/domain_error.log;
>
> And no access log entry is registered whatsoever. I'm using 0.9.4.
>
> Can you elaborate on your 'Variables in access_log should work'?
> Do you mean it should work in a dirname and not on a filename? E.g.:
>
> access_log /var/log/nginx/$test/domain_access.log;

nginx workers must have rights to create files in /var/log/nginx.

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


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

2011年2月26日星期六

RE: nginx can't read images

sorry, but no.. I tried again and it still failed....
it's the caching that makes it like it works






From: aditya15417@hotmail.com
To: nginx@nginx.org
Date: Sun, 27 Feb 2011 07:23:30 +0000
Subject: RE: nginx can't read images

thanks it works now...can you explain what's going on





> To: nginx@nginx.org
> From: iptablez@yahoo.com
> Date: Sun, 27 Feb 2011 07:12:27 +0000
> Subject: Re: nginx can't read images
>
> Above server_name localhost;
>
> + root html;
>
>
> -----Original Message-----
> From: Aditya Herlambang <aditya15417@hotmail.com>
> Date: Sun, 27 Feb 2011 06:44:47
> To: <nginx@nginx.org>
> Reply-To: nginx@nginx.org
> Subject: RE: nginx can't read images
>
> _______________________________________________
> 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: nginx can't read images

thanks it works now...can you explain what's going on





> To: nginx@nginx.org
> From: iptablez@yahoo.com
> Date: Sun, 27 Feb 2011 07:12:27 +0000
> Subject: Re: nginx can't read images
>
> Above server_name localhost;
>
> + root html;
>
>
> -----Original Message-----
> From: Aditya Herlambang <aditya15417@hotmail.com>
> Date: Sun, 27 Feb 2011 06:44:47
> To: <nginx@nginx.org>
> Reply-To: nginx@nginx.org
> Subject: RE: nginx can't read images
>
> _______________________________________________
> 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: nginx can't read images

I don't get it...what do you mean?





> To: nginx@nginx.org
> From: iptablez@yahoo.com
> Date: Sun, 27 Feb 2011 07:12:27 +0000
> Subject: Re: nginx can't read images
>
> Above server_name localhost;
>
> + root html;
>
>
> -----Original Message-----
> From: Aditya Herlambang <aditya15417@hotmail.com>
> Date: Sun, 27 Feb 2011 06:44:47
> To: <nginx@nginx.org>
> Reply-To: nginx@nginx.org
> Subject: RE: nginx can't read images
>
> _______________________________________________
> 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: nginx can't read images

Above server_name localhost;

+ root html;


-----Original Message-----
From: Aditya Herlambang <aditya15417@hotmail.com>
Date: Sun, 27 Feb 2011 06:44:47
To: <nginx@nginx.org>
Reply-To: nginx@nginx.org
Subject: RE: nginx can't read images

_______________________________________________
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: nginx can't read images

The folder should have read access... I don't know what you mean by redirecting requests to folder. 
I just noticed that it can't also read css, js, and png, jpg!!

Here's my error log:

011/02/27 05:53:29 [error] 18679#0: *225 open() "/usr/local/nginx/html/phpMyAdmin/js/mooRainbow/mooRainbow.css" failed (2: No such file or directory), client: 70.176.18.156, server: localhost, request: "GET /phpMyAdmin/js/mooRainbow/mooRainbow.css HTTP/1.1", host: "50.56.81.42", referrer: "http://50.56.81.42/phpMyAdmin/main.php" 2011/02/27 05:53:29 [error] 18679#0: *226 open() "/usr/local/nginx/html/phpMyAdmin/print.css" failed (2: No such file or directory), client: 70.176.18.156, server: localhost, request: "GET /phpMyAdmin/print.css HTTP/1.1", host: "50.56.81.42", referrer: "http://50.56.81.42/phpMyAdmin/main.php" 2011/02/27 05:53:29 [error] 18679#0: *228 open() "/usr/local/nginx/html/phpMyAdmin/themes/original/img/logo_right.png" failed (2: No such file or directory), client: 70.176.18.156, server: localhost, request: "GET /phpMyAdmin/themes/original/img/logo_right.png HTTP/1.1", host: "50.56.81.42", referrer: "http://50.56.81.42/phpMyAdmin/main.php" 2011/02/27 05:53:29 [error] 18679#0: *223 open() "/usr/local/nginx/html/phpMyAdmin/themes/original/img/b_help.png" failed (2: No such file or directory), client: 70.176.18.156, server: localhost, request: "GET /phpMyAdmin/themes/original/img/b_help.png HTTP/1.1", host: "50.56.81.42", referrer: "http://50.56.81.42/phpMyAdmin/main.php" 2011/02/27 05:53:29 [error] 18679#0: *227 open() "/usr/local/nginx/html/phpMyAdmin/themes/original/img/s_warn.png" failed (2: No such file or directory), client: 70.176.18.156, server: localhost, request: "GET /phpMyAdmin/themes/original/img/s_warn.png HTTP/1.1", host: "50.56.81.42", referrer: "http://50.56.81.42/phpMyAdmin/main.php" 2011/02/27 05:53:29 [error] 18679#0: *227 open() "/usr/local/nginx/html/phpMyAdmin/favicon.ico" failed (2: No such file or directory), client: 70.176.18.156, server: localhost, request: "GET /phpMyAdmin/favicon.ico HTTP/1.1", host: "50.56.81.42" 2011/02/27 05:54:39 [error] 18679#0: *237 open() "/usr/local/nginx/html/phpMyAdmin/print.css" failed (2: No such file or directory), client: 70.176.18.156, server: localhost, request: "GET /phpMyAdmin/print.css HTTP/1.1", host: "50.56.81.42", referrer: "http://50.56.81.42/phpMyAdmin/main.php" 2011/02/27 05:54:39 [error] 18679#0: *235 open() "/usr/local/nginx/html/phpMyAdmin/js/mooRainbow/mooRainbow.css" failed (2: No such file or directory), client: 70.176.18.156, server: localhost, request: "GET /phpMyAdmin/js/mooRainbow/mooRainbow.css HTTP/1.1", host: "50.56.81.42", referrer: "http://50.56.81.42/phpMyAdmin/main.php" 2011/02/27 05:54:39 [error] 18679#0: *238 open() "/usr/local/nginx/html/phpMyAdmin/themes/original/img/logo_right.png" failed (2: No such file or directory), client: 70.176.18.156, server: localhost, request: "GET /phpMyAdmin/themes/original/img/logo_right.png HTTP/1.1", host: "50.56.81.42", referrer: "http://50.56.81.42/phpMyAdmin/main.php" 2011/02/27 05:54:39 [error] 18679#0: *239 open() "/usr/local/nginx/html/phpMyAdmin/themes/original/img/b_help.png" failed (2: No such file or directory), client: 70.176.18.156, server: localhost, request: "GET /phpMyAdmin/themes/original/img/b_help.png HTTP/1.1", host: "50.56.81.42", referrer: "http://50.56.81.42/phpMyAdmin/main.php" 2011/02/27 05:54:39 [error] 18679#0: *233 open() "/usr/local/nginx/html/phpMyAdmin/themes/original/img/s_warn.png" failed (2: No such file or directory), client: 70.176.18.156, server: localhost, request: "GET /phpMyAdmin/themes/original/img/s_warn.png HTTP/1.1", host: "50.56.81.42", referrer: "http://50.56.81.42/phpMyAdmin/main.php"

Here's my config:

#user  nobody; worker_processes  1;  #error_log  logs/error.log; #error_log  logs/error.log  notice; #error_log  logs/error.log  info;  #pid        logs/nginx.pid;   events {     worker_connections  1024; }   http {     include       mime.types;     default_type  application/octet-stream;      #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '     #                  '$status $body_bytes_sent "$http_referer" '     #                  '"$http_user_agent" "$http_x_forwarded_for"';      #access_log  logs/access.log  main;      sendfile        on;     #tcp_nopush     on;      #keepalive_timeout  0;     keepalive_timeout  65;      #gzip  on;      server {         listen       80;         server_name  localhost;          #charset koi8-r;          #access_log  logs/host.access.log  main;          location / {             root   html;             index  index.html index.htm;         }          #error_page  404              /404.html;          # redirect server error pages to the static page /50x.html         #         error_page   500 502 503 504  /50x.html;         location = /50x.html {             root   html;         }          location ~ \.(js|css|png|jpg|jpeg|gif|ico|html)$ {                  expires max;         }           # proxy the PHP scripts to Apache listening on 127.0.0.1:80         #         #location ~ \.php$ {         #    proxy_pass   http://127.0.0.1;         #}          # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000         #         location ~ \.php$ {             root           /usr/share/nginx/html;             fastcgi_pass   127.0.0.1:9000;             fastcgi_index  index.php;             fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html$fastcgi_script_name;            include        fastcgi_params;         }          # deny access to .htaccess files, if Apache's document root         # concurs with nginx's one          location ~ /\.ht {             deny  all;         }     }       # another virtual host using mix of IP-, name-, and port-based configuration     #     #server {     #    listen       8000;     #    listen       somename:8080;     #    server_name  somename  alias  another.alias;      #    location / {     #        root   html;     #        index  index.html index.htm;     #    }     #}       # HTTPS server     #     #server {     #    listen       443;     #    server_name  localhost;      #    ssl                  on;     #    ssl_certificate      cert.pem;     #    ssl_certificate_key  cert.key;      #    ssl_session_timeout  5m;      #    ssl_protocols  SSLv2 SSLv3 TLSv1;     #    ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;     #    ssl_prefer_server_ciphers   on;      #    location / {     #        root   html;     #        index  index.html index.htm;     #    }     #}  }






> To: nginx@nginx.org
> From: pchychi@gmail.com
> Date: Sun, 27 Feb 2011 06:39:19 +0000
> Subject: Re: nginx can't read images
>
> What permissions do you have set on the folder? And how are you directing requests to the folder? Can you show us ur config?
>
> Sent from my BlackBerry device on the Rogers Wireless Network
>
> -----Original Message-----
> From: Aditya Herlambang <aditya15417@hotmail.com>
> Date: Sun, 27 Feb 2011 04:47:00
> To: <nginx@nginx.org>
> Reply-To: nginx@nginx.org
> Subject: nginx can't read images
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx