nginx Digest, Vol 3, Issue 42

Yaoxing yaoxing.zhang at gmail.com
Fri Jan 22 06:02:44 MSK 2010


Here's my configuration file

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 /var/log/nginx/access.log main;
#access_log off;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 30;

gzip on;
gzip_disable "MSIE [1-6]\."; #no compression for IE6 due to IE6 bug
gzip_comp_level 9;
gzip_min_length 1024;
gzip_types text/plain text/css application/x-javascript;

upstream cluster {
server 10.9.76.194:80 weight=1 max_fails=1 fail_timeout=10s;
server 10.16.117.68:80 weight=1 max_fails=1 fail_timeout=10s;
}

proxy_cache_path /www/cache levels=1:2 keys_zone=www:2048m inactive=5m 
max_size=5m;
proxy_temp_path /www/cache/temp;
proxy_cache_valid 60m;
proxy_next_upstream error timeout;
proxy_read_timeout 10s;
proxy_connect_timeout 10s;

server {
listen 80;
server_name http_proxy;

error_page 404 = /error/404.html;
error_page 500 502 503 504 = /error/500.html;
location = /500.html {
root /www/htdocs;
}
location ~* customerphotos/ {
proxy_pass http://10.9.76.194:80;
}
location ~* feedbacks/ {
proxy_pass http://10.9.76.194:80;
}
location ~* tools/ {
proxy_read_timeout 30s;
proxy_connect_timeout 30s;
proxy_pass http://10.9.76.194:80;
}
# redirect images to www1
location ~* /productimages {
rewrite ^(.+)$ $scheme://www1.dealextreme.com$1 permanent;
}
# redirect all dealextreme.com request to www.dealextreme.com
if ($host ~* ^dealextreme\.com) {
rewrite ^(.*)$ $scheme://www.dealextreme.com$1 permanent;
}
location ~* (details\.dx)|(products\.dx)|(instantbuy\.ashx) {
proxy_cache www;
proxy_pass http://cluster;
}
# Don't cache dynamic pages now
location ~* (^$)|(/$)|(\.(aspx|dx|ashx)) {
proxy_pass http://cluster;
}
location ~ . {
proxy_cache www;
proxy_pass http://cluster;
}
}
}

Regards,
Yaoxing


于 2010/1/21 17:00, nginx-request at nginx.org 写道:
> Message: 2
> Date: Wed, 20 Jan 2010 16:53:05 +0100
> From: "Piotr Sikora"<piotr.sikora at frickle.com>
> To:<nginx at nginx.org>
> Subject: Re: Messed Response Stream
> Message-ID:<F32D30C73D7B4186855F19A9FCAB3237 at nightmare>
> Content-Type: text/plain; format=flowed; charset="iso-8859-1";
> 	reply-type=original
>
>    
>> 3. Access a page that is different for different users, the issues would
>> happen randomly.
>> (...)
>> I'm sure it's not because of proxy cache
>>      
> Are you saying that you're using proxy cache to cache pages that are
> different for every user? Can you show your configuration? I'm pretty sure
> that bad configuration is source of your problems.
>
> Best regards,
> Piotr Sikora<  piotr.sikora at frickle.com>
>    



More information about the nginx mailing list