Welcome! Log In Create A New Profile

Advanced

memcached error page not work fine

m zy
July 27, 2011 10:14AM
hi, all:
i use nignx and tomat on my web site, tomcat work on 14100 port, i
want when tomcat error i can get the html from my memcache for response,
if html not found in memcache should response c.html to client! but
i set "error_page 404 /c.html;" in @mem don't work for me!
this is my url: http://localhost/pos/2.htm(2 is key for memcache, 2
not found)
the response to client is nginx default 404 page with text:
404 Not Found
not my config c.html (command: error_page 404 /c.html;)
buy if i visit http://localhost/memtest/somepathnotfound c.html
response ok, why?
can everybody help me please ,thank all!


my nginx.conf:

server {
listen 80;
server_name localhost;

#charset koi8-r;
charset gbk;

#access_log logs/host.access.log main;
log_format memc 'status=$status ip="$remote_addr"
time="$time_local" req="$request" args="$args" args2="$arg_PARAMETER"';

error_page 404 /c.html;
location / {
root html;
index index.html index.htm;
}

location ^~ /pos/ {
rewrite ^/pos/(.*)\.(jsp|htm).*$ /index.jsp?$1 last;
}

location ~* \.(htm|jsp)$ {
#proxy_pass http://localhost:8081;
proxy_pass http://localhost:14100;
proxy_intercept_errors on;
error_page 500 502 503 504 @mem;
}

location @mem {
access_log logs/mem.log memc;
set $memcached_key $args;
memcached_pass 10.20.141.149:60001;
proxy_intercept_errors on;
default_type text/html;
error_page 404 /c.html;
}

location /memtest/ {
access_log logs/mem.log memc;
set $memcached_key $args;
memcached_pass 10.20.141.149:60001;
default_type text/html;
error_page 404 /c.html;
}



--
amhaker
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

memcached error page not work fine

m zy July 27, 2011 10:14AM

Re: memcached error page not work fine

Maxim Dounin July 27, 2011 10:42AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 175
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready