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
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 ;-)
Hello,
I've been getting this error a lot in my testing. I never received it
with Apache. I understand what the message say but not why it's coming
about. My headers being sent have length. Or is this message referring
to content returned by PHP at the server end? I'm sure one of you
experts here knows what's going on with this. I only get it on POST
requests and not most of my ajax calls (which are GET).
Thanks for any help with tracking this down. I'm seeing it in Firebug
and when it occurs I cannot see the real response content - even though
content is indeed returned as well since it has effect on my javascript
code and updates the screen. Weird.
Chris :)
Response from server:
<html>
<head><title>411 Length Required</title></head>
<body bgcolor="white">
<center><h1>411 Length Required</h1></center>
<hr><center>nginx/0.6.32</center>
</body>
</html>
Header sent to server using ajax (only removed some identity info, HOST line):
User-Agent Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1)
Gecko/2008072820 Firefox/3.0.1
Accept text/javascript, text/html, application/xml, text/xml, */*
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
X-Requested-With XMLHttpRequest
Content-Type application/x-www-form-urlencoded; charset=utf-8
Referer http://www.xxxxx.com/
Content-Length 269
Cookie ZZZZSession=3ce34bb3dbc257ff61405175f941f1d7
Pragma no-cache
Cache-Control no-cache
I have installed nginx, but I was wondering what do I need to do in order to
be able to type the ip address and instead of getting the welcome screen,
have my webpage come up.
In other words every time I type xx.xx.xx.xx I get "Welcome to Nginx" but I
want to go to my url now. It works fine if I type the domain name but not
the ip
Hi list,
I am currently using Nginx' flv module for streaming some video,
however I have one slight little problem, is that the file can still
be easily downloaded. Is there a way I can protect against that? Is it
an Nginx issue or something to do with the response headers not being
properly set in my application?
I am using nginx (0.6.29) on Freebsd 7 amd64 as a reverse proxy to back end
web sites. It works very well except for php based file uploads.
I googled and found mention of setting the max post/upload/body size on the
php and front end nginx.con and verified that they are correct:
php.ini:
upload_max_filesize = 2M
post_max_size = 3M
upload_tmp_dir = /tmp
nginx.conf: $server is pulled from a map, it maps the host name to backend
server
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_redirect off;
proxy_pass http://$server$request_uri;
client_max_body_size 2M;
client_body_buffer_size 2M;
proxy_buffering off;
proxy_connect_timeout 5;
proxy_send_timeout 90;
proxy_read_timeout 120;
proxy_pass_header Expires;
proxy_pass_header Cache-Control;
proxy_pass_header Last-Modified;
proxy_pass_header ETag;
proxy_pass_header Content-Length;
}
When I do the upload, the temp file does not end up in /tmp although I do
see that the folder is touched (time incremented to the time of the upload).
Am I missing anything simple? I'm stumped and been working on this on and
off for 4 days now.
Hi there,
is it planned to add digest auth at some time ? It's not that basic
auth is not useful, but it's pretty weak on replay attacks. Nowadays,
every common browser supports digest auth so it would be really a
plus.
I'm also interested if it could support internal urls for the internal
password file, like X-Accel-Redirect does. It would be really useful
to delegate authentication to a third-party web application in a
multi-application setup.
--
Cheers,
zimbatm