Welcome! Log In Create A New Profile

Advanced

Re: Suggestions on how to have error pages based on content type

Phillip Oldham
October 27, 2009 04:06AM
How about this (not tested)?
> error_page 503 @maintenance;
>
> location @maintenance {
> auth_basic off;
> root /var/www/foobar/nginx_error_test/system;
>
> if ($content_type ~* javascript) {
> rewrite . /system/maintenance.json last;
> }
>
> if ($content_type ~* xml) {
> rewrite . /system/maintenance.xml last;
> }
>
> rewrite . /system/maintenance.html last;
> }
>
> if (-f $request_filename) {
> break;
> }
>
> if (-f $request_filename.html) {
> rewrite (.*) $1.html last;
> }
>
> }


--

*Phillip B Oldham*
ActivityHQ
phill@activityhq.com <mailto:phill@theactivitypeople.co.uk>

------------------------------------------------------------------------

*Policies*

This e-mail and its attachments are intended for the above named
recipient(s) only and may be confidential. If they have come to you in
error, please reply to this e-mail and highlight the error. No action
should be taken regarding content, nor must you copy or show them to anyone.

This e-mail has been created in the knowledge that Internet e-mail is
not a 100% secure communications medium, and we have taken steps to
ensure that this e-mail and attachments are free from any virus. We must
advise that in keeping with good computing practice the recipient should
ensure they are completely virus free, and that you understand and
observe the lack of security when e-mailing us.

------------------------------------------------------------------------
Subject Author Posted

Suggestions on how to have error pages based on content type

Zev Blut October 24, 2009 04:38AM

Re: Suggestions on how to have error pages based on content type

Zev Blut October 26, 2009 10:16PM

Re: Suggestions on how to have error pages based on content type

Phillip Oldham October 27, 2009 04:06AM

Re: Suggestions on how to have error pages based on content type

Zev Blut October 27, 2009 11:52PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 295
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