Getting built in 404 instead of my custom one

Just noticed that my custom 404 page isn’t getting served in all
circumstances and I’m getting the bare internal 404 at times. Looking at
the debug, it seems to be choosing my 404, but somehow not displaying
it:

2012/10/08 21:09:34 [debug] 13419#0: *6056489 http finalize request:
404,
“/zeep.shtml?” a:1, c:1
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http special response:
404,
“/zeep.shtml?”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 internal redirect:
“/dhe404.shtml?”

If it’s redirecting to the dhe404.shtml file, why isn’t it serving it?
Could it be an issue with the fastcgi cache? (shtml files are actually
php)

On Mon, October 8, 2012 10:16 pm, Ian M. Evans wrote:

On Mon, October 8, 2012 9:49 pm, Ian M. Evans wrote:

Just noticed that my custom 404 page isn’t getting served in all
circumstances and I’m getting the bare internal 404 at times. Looking at
the debug, it seems to be choosing my 404, but somehow not displaying
it:

here’s a longer bit of the debug:

hmm, disabled the fastcgi cache and it served my error file okay.
enabled
the cache and it served the nginx internal 404.

Here’s our cache setup:

fastcgi_cache_path /var/lib/nginx/fastcgicache levels=1:2
keys_zone=MYCACHE:5m inactive=2h max_size=1g loader_files=1000
loader_threshold=2000;
map $http_cookie $no_cache { default 0; ~SESS 1; }
fastcgi_cache_key “$scheme$request_method$host$request_uri”;
add_header X-My-Cache $upstream_cache_status;

map $uri $no_cache_dirs {
default 0;
~^/(?:phpMyAdmin|rather|poll|webmail|skewed|blogs|galleries|pixcache)
1;
}

Should I toss the custom 404 into a non-cached subdir?

On Mon, October 8, 2012 9:49 pm, Ian M. Evans wrote:

Just noticed that my custom 404 page isn’t getting served in all
circumstances and I’m getting the bare internal 404 at times. Looking at
the debug, it seems to be choosing my 404, but somehow not displaying it:

here’s a longer bit of the debug:

2012/10/08 21:09:34 [debug] 13419#0: *6056489 accept: 24.212.205.68 fd:5
2012/10/08 21:09:34 [debug] 13419#0: *6056489 event timer add: 5:
60000:1125303069
2012/10/08 21:09:34 [debug] 13419#0: *6056489 epoll add event: fd:5 op:1
ev:80000001
2012/10/08 21:09:34 [debug] 13419#0: *6056489 post event 0920CD1C
2012/10/08 21:09:34 [debug] 13419#0: *6056489 delete posted event
0920CD1C
2012/10/08 21:09:34 [debug] 13419#0: *6056489 malloc: 0922DA80:660
2012/10/08 21:09:34 [debug] 13419#0: *6056489 malloc: 09220E70:1024
2012/10/08 21:09:34 [debug] 13419#0: *6056489 posix_memalign:
091E7FE0:4096 @16
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http process request line
2012/10/08 21:09:34 [debug] 13419#0: *6056489 recv: fd:5 1024 of 1024
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http request line: “GET
/zeep.shtml HTTP/1.1”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http uri: “/zeep.shtml”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http args: “”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http exten: “shtml”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http process request
header
line
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http header: “Host:
www.example.com
2012/10/08 21:09:34 [debug] 13419#0: 6056489 http header: “User-Agent:
Mozilla/5.0 (Windows NT 6.0; WOW64; rv:15.0) Gecko/20100101
Firefox/15.0.1”
2012/10/08 21:09:34 [debug] 13419#0: 6056489 http header: "Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,
/
;q=0.8"
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http header:
“Accept-Language: en-us,en;q=0.5”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http header:
“Accept-Encoding: gzip, deflate”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http header: “DNT: 1”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http header: “Connection:
keep-alive”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http alloc large header
buffer
2012/10/08 21:09:34 [debug] 13419#0: *6056489 posix_memalign:
091EE230:256
@16
2012/10/08 21:09:34 [debug] 13419#0: *6056489 malloc: 09219C88:8192
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http large header alloc:
09219C88 8192
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http large header copy:
714
2012/10/08 21:09:34 [debug] 13419#0: *6056489 recv: fd:5 388 of 7478
2012/10/08 21:09:34 [debug] 13419#0: *6056489 recv: fd:5 -1 of 7090
2012/10/08 21:09:34 [debug] 13419#0: *6056489 recv() not ready (11:
Resource temporarily unavailable)
2012/10/08 21:09:34 [debug] 13419#0: *6056489 post event 0920CD1C
2012/10/08 21:09:34 [debug] 13419#0: *6056489 delete posted event
0920CD1C
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http process request
header
line
2012/10/08 21:09:34 [debug] 13419#0: *6056489 recv: fd:5 356 of 7090
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http header done
2012/10/08 21:09:34 [debug] 13419#0: *6056489 event timer del: 5:
1125303069
2012/10/08 21:09:34 [debug] 13419#0: *6056489 rewrite phase: 0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script complex value
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var:
“/usr/local/nginx/htdocs”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var: “0”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http map started
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var:
“/zeep.shtml”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http map: “/zeep.shtml”
“0”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var: “0”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 add cleanup: 091E8B48
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http file cache exists: -5
e:0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 cache file:
“/var/lib/nginx/fastcgicache/e/43/f170708cf22b5b20fc1f7ca3cfcf943e”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http file cache lock u:1
wt:0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http upstream cache: -5
2012/10/08 21:09:34 [debug] 13419#0: *6056489 posix_memalign:
091C5650:4096 @16
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script copy:
“GATEWAY_INTERFACE”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script copy:
“CGI/1.1”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param:
“GATEWAY_INTERFACE: CGI/1.1”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script copy:
“SERVER_SOFTWARE”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script copy: “nginx”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param:
“SERVER_SOFTWARE: nginx”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script copy:
“QUERY_STRING”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param:
"QUERY_STRING: "
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script copy:
“REQUEST_METHOD”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var: “GET”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param:
“REQUEST_METHOD: GET”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script copy:
“CONTENT_TYPE”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param:
"CONTENT_TYPE: "
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script copy:
“CONTENT_LENGTH”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param:
“CONTENT_LENGTH: "
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script copy:
“SCRIPT_FILENAME”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var:
“/usr/local/nginx/htdocs”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var:
“/zeep.shtml”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param:
“SCRIPT_FILENAME: /usr/local/nginx/htdocs/zeep.shtml”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script copy:
“PATH_TRANSLATED”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var:
“/usr/local/nginx/htdocs”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var:
“/zeep.shtml”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param:
“PATH_TRANSLATED: /usr/local/nginx/htdocs/zeep.shtml”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script copy:
“REQUEST_URI”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var:
“/zeep.shtml”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param:
“REQUEST_URI:
/zeep.shtml”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script copy:
“DOCUMENT_URI”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var:
“/zeep.shtml”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param:
“DOCUMENT_URI: /zeep.shtml”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script copy:
“DOCUMENT_ROOT”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var:
“/usr/local/nginx/htdocs”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param:
“DOCUMENT_ROOT: /usr/local/nginx/htdocs”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script copy:
“SERVER_PROTOCOL”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var:
“HTTP/1.1”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param:
“SERVER_PROTOCOL: HTTP/1.1”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script copy:
“REMOTE_ADDR”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var:
“24.212.205.68”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param:
“REMOTE_ADDR:
24.212.205.68”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script copy:
“REMOTE_PORT”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var: “54558”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param:
“REMOTE_PORT:
54558”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script copy:
“SERVER_ADDR”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var:
“67.19.142.122”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param:
“SERVER_ADDR:
67.19.142.122”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script copy:
“SERVER_PORT”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var: “80”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param:
“SERVER_PORT:
80”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script copy:
“SERVER_NAME”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var:
www.example.com
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param:
“SERVER_NAME:
www.example.com
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param: “HTTP_HOST:
www.example.com
2012/10/08 21:09:34 [debug] 13419#0: 6056489 fastcgi param:
“HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:15.0)
Gecko/20100101 Firefox/15.0.1”
2012/10/08 21:09:34 [debug] 13419#0: 6056489 fastcgi param:
"HTTP_ACCEPT:
text/html,application/xhtml+xml,application/xml;q=0.9,
/
;q=0.8”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param:
“HTTP_ACCEPT_LANGUAGE: en-us,en;q=0.5”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param:
“HTTP_ACCEPT_ENCODING: gzip, deflate”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param: “HTTP_DNT:
1”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 fastcgi param:
“HTTP_CONNECTION: keep-alive”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http cleanup add: 091E8C54
2012/10/08 21:09:34 [debug] 13419#0: *6056489 get rr peer, try: 1
2012/10/08 21:09:34 [debug] 13419#0: *6056489 socket 10
2012/10/08 21:09:34 [debug] 13419#0: *6056489 epoll add connection:
fd:10
ev:80000005
2012/10/08 21:09:34 [debug] 13419#0: *6056489 connect to
127.0.0.1:10004,
fd:10 #6056490
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http upstream connect: -2
2012/10/08 21:09:34 [debug] 13419#0: *6056489 posix_memalign:
091C0330:128
@16
2012/10/08 21:09:34 [debug] 13419#0: *6056489 event timer add: 10:
60000:1125303437
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http finalize request: -4,
“/zeep.shtml?” a:1, c:2
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http request count:2 blk:0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 post event 09264228
2012/10/08 21:09:34 [debug] 13419#0: *6056489 post event 092641F4
2012/10/08 21:09:34 [debug] 13419#0: *6056489 delete posted event
092641F4
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http run request:
“/zeep.shtml?”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http upstream check
client,
write event:1, “/zeep.shtml”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http upstream recv(): -1
(11: Resource temporarily unavailable)
2012/10/08 21:09:34 [debug] 13419#0: *6056489 delete posted event
09264228
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http upstream request:
“/zeep.shtml?”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http upstream send request
handler
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http upstream send request
2012/10/08 21:09:34 [debug] 13419#0: *6056489 chain writer buf fl:0
s:2256
2012/10/08 21:09:34 [debug] 13419#0: *6056489 chain writer in: 091E8C70
2012/10/08 21:09:34 [debug] 13419#0: *6056489 writev: 2256
2012/10/08 21:09:34 [debug] 13419#0: *6056489 chain writer out: 00000000
2012/10/08 21:09:34 [debug] 13419#0: *6056489 event timer del: 10:
1125303437
2012/10/08 21:09:34 [debug] 13419#0: *6056489 event timer add: 10:
60000:1125303439
2012/10/08 21:09:34 [debug] 13419#0: *6056489 post event 0920CD50
2012/10/08 21:09:34 [debug] 13419#0: *6056489 post event 09264228
2012/10/08 21:09:34 [debug] 13419#0: *6056489 delete posted event
09264228
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http upstream request:
“/zeep.shtml?”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http upstream dummy
handler
2012/10/08 21:09:34 [debug] 13419#0: *6056489 delete posted event
0920CD50
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http upstream request:
“/zeep.shtml?”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http upstream process
header
2012/10/08 21:09:34 [debug] 13419#0: *6056489 malloc: 091C6658:4096
2012/10/08 21:09:34 [debug] 13419#0: *6056489 recv: fd:10 128 of 4029
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http fastcgi record byte:
01
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http fastcgi record byte:
06
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http fastcgi record byte:
00
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http fastcgi record byte:
01
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http fastcgi record byte:
00
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http fastcgi record byte:
64
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http fastcgi record byte:
04
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http fastcgi record byte:
00
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http fastcgi record
length: 100
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http fastcgi parser: 0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http fastcgi header:
“Status: 404 Not Found”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http fastcgi parser: 0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http fastcgi header:
“X-Powered-By: PHP/5.3.6”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http fastcgi parser: 0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http fastcgi header:
“Content-type: text/html”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http fastcgi parser: 1
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http fastcgi header done
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http file cache free, fd:
-1
2012/10/08 21:09:34 [debug] 13419#0: *6056489 finalize http upstream
request: 404
2012/10/08 21:09:34 [debug] 13419#0: *6056489 finalize http fastcgi
request
2012/10/08 21:09:34 [debug] 13419#0: *6056489 free rr peer 1 0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 close http upstream
connection: 10
2012/10/08 21:09:34 [debug] 13419#0: *6056489 free: 091C0330, unused: 88
2012/10/08 21:09:34 [debug] 13419#0: *6056489 event timer del: 10:
1125303439
2012/10/08 21:09:34 [debug] 13419#0: *6056489 reusable connection: 0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http finalize request:
404,
“/zeep.shtml?” a:1, c:1
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http special response:
404,
“/zeep.shtml?”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 internal redirect:
“/dhe404.shtml?”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 rewrite phase: 0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script complex value
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var:
“/usr/local/nginx/htdocs”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script copy:
"/maintenance.html4 [debug] 13419#0: *6056489 generic phase: 4
2012/10/08 21:09:34 [debug] 13419#0: *6056489 generic phase: 5
2012/10/08 21:09:34 [debug] 13419#0: *6056489 access phase: 6
2012/10/08 21:09:34 [debug] 13419#0: *6056489 access phase: 7
2012/10/08 21:09:34 [debug] 13419#0: *6056489 post access phase: 8
2012/10/08 21:09:34 [debug] 13419#0: *6056489 try files phase: 9
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http init upstream, client
timer: 0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var: “http”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var: “GET”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var:
www.example.com
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var:
“/zeep.shtml”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http cache key:
httpGETwww.example.com/zeep.shtml
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var: “0”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http script var: “0”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 add cleanup: 091E8F50
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http file cache exists: 0
e:0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http upstream cache: 404
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http finalize request:
404,
“/dhe404.shtml?” a:1, c:3
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http special response:
404,
“/dhe404.shtml?”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http set discard body
2012/10/08 21:09:34 [debug] 13419#0: *6056489 charset: “” > “ISO-8859-1”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 HTTP/1.1 404 Not Found
2012/10/08 21:09:34 [debug] 13419#0: *6056489 write new buf t:1 f:0
0921CAE4, pos 0921CAE4, size: 174 file: 0, size: 0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http write filter: l:0 f:0
s:174
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http output filter
“/dhe404.shtml?”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http copy filter:
“/dhe404.shtml?”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http postpone filter
“/dhe404.shtml?” 091E8FD8
2012/10/08 21:09:34 [debug] 13419#0: *6056489 write old buf t:1 f:0
0921CAE4, pos 0921CAE4, size: 174 file: 0, size: 0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 write new buf t:0 f:0
00000000, pos 080CA180, size: 116 file: 0, size: 0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 write new buf t:0 f:0
00000000, pos 080C9AE0, size: 52 file: 0, size: 0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http write filter: l:1 f:0
s:342
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http write filter limit 0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 writev: 342
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http write filter 00000000
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http copy filter: 0
“/dhe404.shtml?”
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http finalize request: 0,
“/dhe404.shtml?” a:1, c:3
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http request count:3 blk:0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http finalize request: -4,
“/dhe404.shtml?” a:1, c:2
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http request count:2 blk:0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http finalize request: -4,
“/dhe404.shtml?” a:1, c:1
2012/10/08 21:09:34 [debug] 13419#0: *6056489 set http keepalive handler
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http close request
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http log handler
2012/10/08 21:09:34 [debug] 13419#0: *6056489 run cleanup: 091E8F50
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http file cache cleanup
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http file cache free, fd:
-1
2012/10/08 21:09:34 [debug] 13419#0: *6056489 run cleanup: 091E8B48
2012/10/08 21:09:34 [debug] 13419#0: *6056489 free: 091C6658
2012/10/08 21:09:34 [debug] 13419#0: *6056489 free: 091E7FE0, unused: 0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 free: 0921BC90, unused:
104
2012/10/08 21:09:34 [debug] 13419#0: *6056489 free: 091C5650, unused:
1636
2012/10/08 21:09:34 [debug] 13419#0: *6056489 event timer add: 5:
5000:1125248440
2012/10/08 21:09:34 [debug] 13419#0: *6056489 free: 0922DA80
2012/10/08 21:09:34 [debug] 13419#0: *6056489 free: 09220E70
2012/10/08 21:09:34 [debug] 13419#0: *6056489 hc free: 00000000 0
2012/10/08 21:09:34 [debug] 13419#0: *6056489 hc busy: 09237D08 1
2012/10/08 21:09:34 [debug] 13419#0: *6056489 free: 09219C88
2012/10/08 21:09:34 [debug] 13419#0: *6056489 tcp_nodelay
2012/10/08 21:09:34 [debug] 13419#0: *6056489 reusable connection: 1
2012/10/08 21:09:34 [debug] 13419#0: *6056489 post event 0920CD1C
2012/10/08 21:09:34 [debug] 13419#0: *6056489 delete posted event
0920CD1C
2012/10/08 21:09:34 [debug] 13419#0: *6056489 http keepalive handler
2012/10/08 21:09:34 [debug] 13419#0: *6056489 malloc: 09220E70:1024
2012/10/08 21:09:34 [debug] 13419#0: *6056489 recv: fd:5 -1 of 1024
2012/10/08 21:09:34 [debug] 13419#0: *6056489 recv() not ready (11:
Resource temporarily unavailable)
2012/10/08 21:09:39 [debug] 13419#0: *6056489 event timer del: 5:
1125248440
2012/10/08 21:09:39 [debug] 13419#0: *6056489 http keepalive handler
2012/10/08 21:09:39 [debug] 13419#0: *6056489 close http connection: 5
2012/10/08 21:09:39 [debug] 13419#0: *6056489 reusable connection: 0
2012/10/08 21:09:39 [debug] 13419#0: *6056489 free: 09220E70
2012/10/08 21:09:39 [debug] 13419#0: *6056489 free: 00000000
2012/10/08 21:09:39 [debug] 13419#0: *6056489 free: 00000000
2012/10/08 21:09:39 [debug] 13419#0: *6056489 free: 09237C40, unused: 16
2012/10/08 21:09:39 [debug] 13419#0: *6056489 free: 091EE230, unused:
188

On Mon, October 8, 2012 10:55 pm, Ian M. Evans wrote:
[snip]

add_header X-My-Cache $upstream_cache_status;

map $uri $no_cache_dirs {
default 0;
~^/(?:phpMyAdmin|rather|poll|webmail|skewed|blogs|galleries|pixcache)
1;
}

Should I toss the custom 404 into a non-cached subdir?

that didn’t work.

It’s definitely the fastcgi cache interfering with the php-parsed custom
error page.

I’m scratching my head here.

My fastcgi.conf contains this additional cache info:

fastcgi_cache MYCACHE;
fastcgi_keep_conn on;
fastcgi_cache_bypass $no_cache $no_cache_dirs;
fastcgi_no_cache $no_cache $no_cache_dirs;
fastcgi_cache_valid 200 301 5m;
fastcgi_cache_valid 302 5m;
fastcgi_cache_valid 404 1m;
fastcgi_cache_use_stale error timeout invalid_header updating http_500;
fastcgi_ignore_headers Cache-Control Expires;
expires epoch;
fastcgi_cache_lock on;

I thought adding:

map $uri $no_cache { default 0;
/dhe404.shtml 1;
}

in my nginx.conf would do the trick, but nope. How can I stop the
fastcgi_cache from handling the custom error page?

Thanks.

On Tue, October 9, 2012 3:57 am, Igor S. wrote:

fastcgi_cache_path /var/lib/nginx/fastcgicache levels=1:2
}

fastcgi_ignore_headers Cache-Control Expires;
fastcgi_cache from handling the custom error page?

The issue is in fastcgi_cache_key:
fastcgi_cache_key “$scheme$request_method$host$request_uri”;

It always uses client original $request_uri. Try:
fastcgi_cache_key “$scheme$request_method$host$uri?$args”;

Thanks, Igor. It sort of worked. I’m now getting the custom 404, but
it’s
a cached version of the custom 404 php file.

That is, my custom 404 tells the visitor:

“Hmmmmthe page you’re looking for [ /zap.shtml ] doesn’t seem to be on
our site. [etc, etc]” If I then do another file name that doesn’t exist,
say, test1.shtml, I’m getting a cached version of the 404 as instead of
saying test1.shtml, it still says “Hmmmmthe page you’re looking for [
/zap.shtml ] doesn’t seem to be on our site.”

So, though it’s now serving the custom 404, it’s still serving a cached
version. So I guess I need a way to turn off caching for the custom 404
file. Just tried another one and, of course, got a cached 404 that
someone
else had just tried.

On Mon, Oct 08, 2012 at 11:51:21PM -0400, Ian M. Evans wrote:

loader_threshold=2000;
Should I toss the custom 404 into a non-cached subdir?

fastcgi_cache_lock on;

I thought adding:

map $uri $no_cache { default 0;
/dhe404.shtml 1;
}

in my nginx.conf would do the trick, but nope. How can I stop the
fastcgi_cache from handling the custom error page?

The issue is in fastcgi_cache_key:
fastcgi_cache_key “$scheme$request_method$host$request_uri”;

It always uses client original $request_uri. Try:
fastcgi_cache_key “$scheme$request_method$host$uri?$args”;


Igor S.

On Oct 9, 2012, at 12:34 , Ian M. Evans wrote:

location = /dhe404.shtml {
fastcgi_pass 127.0.0.1:10004;
fastcgi_cache_valid 0s;
}

and made the cache valid 0. Seems to work.

location = /dhe404.shtml {
fastcgi_pass …
fastcgi_cache off;
}


Igor S.

On Tue, October 9, 2012 4:46 am, Igor S. wrote:

Think I solved the cached issue.
location = /dhe404.shtml {
fastcgi_pass …
fastcgi_cache off;
}

that’s better, thanks.

On Tue, October 9, 2012 4:26 am, Ian M. Evans wrote:
[snip]

So, though it’s now serving the custom 404, it’s still serving a cached
version. So I guess I need a way to turn off caching for the custom 404
file. Just tried another one and, of course, got a cached 404 that someone
else had just tried.

Think I solved the cached issue.

Just created the location:

location = /dhe404.shtml {
fastcgi_pass 127.0.0.1:10004;
fastcgi_cache_valid 0s;
}

and made the cache valid 0. Seems to work.