Re: Change error page by file type?

Yes, however due to the complexity of our configuration (which includes
many location blocks with several proxy_pass blocks inside), I am trying
to avoid duplicating location blocks for this purpose.

I found something promising, however. According to the docs the the
error_log directive is supported “if in location” as a context which it
can be used in. Therefore I am thinking I can just add a group of if
statements with regex checking inside of one location block and use the
“if” block to set up the error_logs. I’ll give this a try.

----- Original Message ----
From: Roxis [email protected]
To: [email protected]
Sent: Friday, May 16, 2008 4:06:18 AM
Subject: Re: Change error page by file type?

On Friday 16 May 2008, Roxis wrote:

If someone makes a request for a .js file from our server and no such

  • location ~ /something/.+.js {
  • location ~ ^/something/.+.js$ {
#config for location /something/
error_page 404 /errors/error.js;


  • location ~ /something/.+.htm {
  • location ~ ^/something/.+.htm$ {