nginx Digest, Vol 4, Issue 21
Yaoxing
yaoxing.zhang at gmail.com
Sat Feb 6 09:08:59 MSK 2010
Sure. I also tried nginx 0.8.33, same problem.
I use output cache for some other pages but not for this problem page.
Once I should get Nginx work properly, I think I'll remove output cache
from those pages so that I can reduce stress of IIS.
Any way, here's the config file. And I'm keep testing. I'll let you know
if I find any solution.
#user nobody;
worker_processes 4;
#error_log /var/log/nginx/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid /var/run/nginx/nginx.pid;
events {
worker_connections 32768;
}
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 30;
gzip on;
gzip_disable "MSIE [1-6]\."; #no compression for IE6 due to IE6 bug
gzip_comp_level 9;
gzip_min_length 1024; #no compression for less than 1K responses
gzip_types text/plain text/css application/x-javascript;
upstream cluster {
#server 10.x.x.x:80 weight=1 max_fails=1 fail_timeout=10s;
#server 10.x.x.x:80 weight=1 max_fails=1 fail_timeout=10s;
server 10.x.x.x: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;
listen 443 default ssl;
server_name www.domain.com;
ssl_certificate aaa.pem;
ssl_certificate_key bbb.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;
#charset koi8-r;
#access_log logs/host.access.log main;
error_page 404 = /error/404.html;
error_page 500 502 503 504 = /error/500.html;
# only the main server serves customer photos now.
# TODO: change code to make all the servers be capable to serve customer
photos
location ~* customerphotos/ {
proxy_pass http://10.x.x.x:80;
add_header Cluster-Server main;
}
# make sure all the customer photos are uploaded to the same server
location ~* feedbacks/ {
proxy_pass http://10.x.x.x:80;
add_header Cluster-Server main;
}
# pages under this folder need longer time to run
location ~* tools/ {
proxy_read_timeout 30s;
proxy_connect_timeout 30s;
proxy_pass http://10.x.x.x:80;
}
# redirect images to www1
location ~* /productimages {
rewrite ^(.+)$ $scheme://www1.domain.com$1 permanent;
}
# redirect all domain.com request to www.domain.com
if ($host ~* ^domain\.com) {
rewrite ^(.*)$ $scheme://www.domain.com$1 permanent;
}
# cache several special pages.
location ~* (details\.dx)|(products\.dx)|(instantbuy\.ashx) {
proxy_cache www;
proxy_pass http://cluster;
add_header Object-Type static;
}
# Don't cache dynamic pages
location ~* (^$)|(/$)|(\.(aspx|dx|ashx)) {
proxy_pass http://cluster;
add_header Object-Type dynamic;
}
# cache other pages
location ~ . {
proxy_cache www;
proxy_pass http://cluster;
add_header Object-Type static;
}
}
}
Regards,
Yaoxing
于 2010/2/6 12:43, nginx-request at nginx.org 写道:
> Can you post your nginx config (trimmed of anything sensitive of course)?
>
> I am interested as I am about to introduce nginx 0.7.65 with
> proxy_cache into a high-volume production environment myself, and want
> to make sure I won't experience this same issue. We haven't seen it
> the issue in testing, but our automated load testing tools can't check
> for this case (mis-directed pages). We are also proxying to IIS
> running ASP.NET applications.
>
> Are you using the ASP.NET cache at all on the IIS servers?
>
> -- RPM
More information about the nginx
mailing list