<meta http-equiv="content-type" content="text/html; charset=utf-8">hi, all:<div> 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,</div>
<div> 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!</div><div> this is my url: <a href="http://localhost/pos/2.htm(2">http://localhost/pos/2.htm(2</a> is key for memcache, 2 not found)</div>
<div> the response to client is nginx default 404 page with text:</div><div><span class="Apple-style-span" style="font-size: 26px; font-weight: bold; "> 404 Not Found</span></div><div> not my config c.html (command: error_page 404 /c.html;)</div>
<div> buy if i visit <a href="http://localhost/memtest/somepathnotfound">http://localhost/memtest/somepathnotfound</a> c.html response ok, why?</div><div> can everybody help me please ,thank all!</div><div><br>
</div><div><br></div><div>my nginx.conf:</div><div><br></div><div><div> server {</div><div> listen 80;</div><div> server_name localhost;</div><div><br></div><div> #charset koi8-r;</div><div>
<span class="Apple-tab-span" style="white-space: pre; "> </span>charset gbk;</div><div><br></div><div> #access_log logs/host.access.log main;</div><div> log_format memc 'status=$status ip="$remote_addr" time="$time_local" req="$request" args="$args" args2="$arg_PARAMETER"';</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space: pre; "> </span>error_page 404 /c.html;</div><div> location / {</div><div> root html;</div><div> index index.html index.htm;</div>
<div> }</div><div><br></div><div><span class="Apple-tab-span" style="white-space: pre; "> </span>location ^~ /pos/ {</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span> rewrite ^/pos/(.*)\.(jsp|htm).*$ /index.jsp?$1 last;</div>
<div><span class="Apple-tab-span" style="white-space: pre; "> </span>}</div><div><br></div><div> <span class="Apple-tab-span" style="white-space: pre; "> </span>location ~* \.(htm|jsp)$ {</div><div> #proxy_pass <a href="http://localhost:8081">http://localhost:8081</a>;</div>
<div> proxy_pass <a href="http://localhost:14100">http://localhost:14100</a>;</div><div> <span class="Apple-tab-span" style="white-space: pre; "> </span> proxy_intercept_errors on;</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span> error_page 500 502 503 504 @mem;</div>
<div> }</div><div><br></div><div><span class="Apple-tab-span" style="white-space: pre; "> </span>location @mem {</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span> access_log logs/mem.log memc;</div>
<div><span class="Apple-tab-span" style="white-space: pre; "> </span> set $memcached_key $args;</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span> memcached_pass <a href="http://10.20.141.149:60001">10.20.141.149:60001</a>;</div>
<div><span class="Apple-tab-span" style="white-space: pre; "> </span> proxy_intercept_errors on;</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span> default_type text/html;</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span> error_page 404 /c.html;</div>
<div><span class="Apple-tab-span" style="white-space: pre; "> </span>}</div><div><br></div><div><span class="Apple-tab-span" style="white-space: pre; "> </span>location /memtest/ {</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span> access_log logs/mem.log memc;</div>
<div><span class="Apple-tab-span" style="white-space: pre; "> </span> set $memcached_key $args;</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span> memcached_pass <a href="http://10.20.141.149:60001">10.20.141.149:60001</a>;</div>
<div><span class="Apple-tab-span" style="white-space: pre; "> </span> default_type text/html;</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span> error_page 404 /c.html;</div><div><span class="Apple-tab-span" style="white-space: pre; "> </span>}</div>
</div><div><br></div><br clear="all"><br>-- <br>amhaker