Hello,
I have a fresh new installation of nginx on ubuntu 8.04 (installed via
apt-get, I believe it is 0.5.x something)
In my nginx.conf file I have gzip turned on, now I wanted to do a basic test
and serving a static html file, but the file does not come compressed at
all.
Here's the snippet of configuration, I tried variations on this without
success
gzip on;
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_proxied any;
gzip_types text/plain text/html text/css application/x-javascript
text/xml application/xml application/xml+rss text/javascript;
gzip_http_version 1.1;
gzip_comp_level 6;
Does anyone have any idea why nothing is compressed?
I've used this http://www.gidnetwork.com/tools/gzip-test.php and others to
test the results.
Thank you so much!
Can anyone recommend a good log analysis tool that is a good match for nginx? I'd like something that is flexible, where I can tell it which fields in the format are for which parts of the data (i.e. user agent is field 6) etc. Thanks! Note that I am looking for a SERVER SIDE tool to process the nginx logs (JavaScript based analytics tools will not work for this particular application).
Hello,
I have some problems running (perl) cgi scripts with nginx.
I followed the config at http://wiki.codemongers.com/NginxSimpleCGI
Perl scripts work very well as long as they use method=get in forms. If
they use method=post, it seems no input is passed to the cgi.
I saw in perl-fcgi.pl that there was some lines: "if
(($req_params{'REQUEST_METHOD'} eq 'POST') && ($req_len != 0) ){ "
Which should pass the info
Has someone an idea of what's happening?
Regards
Hi All
I'm trying to move a bunch of rails apps from an apache/fastcgi
platform to nginx/mongrel_cluster.
What I want is something like this;
http://my.server/app1 --> mongrel_cluster1
http://my.server/app2 --> mongrel_cluster2
I can do this in nginx with something like this;
...
upstream mongrel_cluster1 {
server 127.0.0.1:3001;
server 127.0.0.1:3002;
}
upstream mongrel_cluster2 {
server 127.0.0.1:4001;
server 127.0.0.1:4002;
}
server {
...
location /app1 {
proxy_pass http://mongrel_cluster1;
break;
}
location /app2 {
proxy_pass http://mongrel_cluster2;
break;
}
...
But, the problem is that I'm now hitting my rails apps with paths like
this;
/app1/controller/method
/app2/controller/method
...when the apps want the paths to be just /controller/method
So, I want to use something like this to remove the 'app1' part;
rewrite ^/app1/(.*)$ /$1 permanent;
But, that seems to override the proxy_pass directive, because if I put
that in my location blocks, I just get 404 errors, and it's not
allowed in my upstream blocks.
I know I could use virtual hosts, with a different subdomain for each
app, but that would be this;
http://app1.my.server --> mongrel_cluster1
http://app2.my.server --> mongrel_cluster2
...which is not what I want.
Is there any way to achieve what I want, using nginx?
Thanks in advance for any help.
David
//////////////////////////////////////////////////////////////////////////////////////////////////////////
gdrive_timer_wev.handler=test_timer;
ngx_add_timer(&gdrive_timer_wev, 5);
static
void test_timer(ngx_event_t *wev)
{
ngx_log_error(NGX_LOG_DEBUG, wev->log, 0, "timer out");
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
i want to set a timer in nginx's main loop, but why this make not any effect?
how to set the timer?
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,4265,4265#msg-4265
When I post when a JavaScript file, "405 not allowed" error will appear.
if use proxy, it can work.
error_page 405 =200 @405;
location @405 {
root /htdocs;
proxy_pass http://localhost:8080;
}
but I do not want to use proxy, just want to use Nginx, can to achieve it?
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,2414,2414#msg-2414
My configuration is:
Apache listening on port 80, Iptables redirecting port 80 to port 8080, Nginx listening on port 8080.
I have been using Nginx with the same configuration for several months (0.7.x and 0.8.x):
--conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/dev/shm/client --http-proxy-temp-path=/dev/shm/proxy --http-fastcgi-temp-path=/dev/shm/fastcgi --with-debug --with-http_stub_status_module --with-http_flv_module --with-http_ssl_module --with-http_dav_module --with-http_secure_link_module
And until latest version i had no issue starting Nginx, yet today after compiling 0.8.4 i got the following error:
the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
configuration file /usr/local/nginx/conf/nginx.conf test is successful
Starting nginx: : bind() to 0.0.0.0:80 failed (98: Address already in use )
: bind() to 0.0.0.0:80 failed (98: Address already in use)
: bind() to 0.0.0.0:80 failed (98: Address already in use)
: bind() to 0.0.0.0:80 failed (98: Address already in use)
: bind() to 0.0.0.0:80 failed (98: Address already in use)
: still could not bind()
nginx.
Any idea of what is going wrong ?
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,3498,3498#msg-3498
Hi All!
I'm new on this nice discussion list but I'm a long time lurker.
I'm working on a very specific module for Nginx: a complete CMS. It may
sounds strange since upstream servers and scripting languages are the
norm for the CMS, but I want (and need) speed.
So far I've done many things without too much trouble, but I'm a little
bit stuck with the processing of events in Nginx. I would like to
process a specific event which is not connection related but created by
one of my worker threads.
I hope this short example will be clear:
// My specific Nginx http handler
int my_http_handler (ngx_request_t * r)
{
if (r->my_state == 0) // first step: initiate the work to do
{
r->my_state ++ ;
my_sendmsg (myqueue,r) ; // send a message to worker
return NGX_AGAIN ; // please call me back when done
}
else // second step: results are ready
{
// produce xhtml output from results
return NGX_OK ; // finished
}
}
// The worker running on a specific thread
void my_http_worker (void * arg)
{
ngx_http_request_t * r ;
ngx_event_t * ev ;
while (1)
{
my_recvmsg (myqueue,r) ;
// processing the request
// ...
// wake up my_http_handler
ngx_post_event (ev, (ngx_event_t * *) & ngx_posted_events) ;
}
}
But I don't know how to fill the ngx_event_t (in particular the
handlers) in order to call again my_http_handler on Nginx's context.
I believe it's possible to do so from what I've seen, but Nginx's code
is not so easy to enter on (it's not a critic).
Sorry for this (first) long message but I think it would be nice to be
able to develop clean and non blocking modules for Nginx.
BTW forgive my English, I'm French ;-)
Patch creates limit_rate_after directive:
limit_rate_after 1m;
limit_rate 100k;
The directive limits speed only after the first part was sent.
--
Igor Sysoev
http://sysoev.ru/en/