Welcome! Log In Create A New Profile

Advanced

Re: Custom error pages

Bai Shen
April 03, 2012 04:14PM
My conf looks like this.

server {
listen 192.168.1.1:80;
server_name example.com;

error_page 503 /maint/503.html;

location /maint/503.html {
internal;
}

location /maint/ {
root /etc/nginx/html;
}

server {
listen 192.168.1.1:80;
server_name example.com;

location / {
proxy_pass http://192.168.1.2;
}
}


To show the 503 page instead of my site, I uncomment the top server block.
When I want to bring the site back, I comment the top block out. The
/maint/ location was what I changed to get the css and images to work.
However, I'm not sure that it's the best solution. Also, I'm assuming that
there's a better way to show/hide the 503 page than commenting out the
whole server block.

On Wed, Mar 28, 2012 at 5:16 PM, Francis Daly <francis@daoine.org> wrote:

> On Wed, Mar 28, 2012 at 03:42:45PM -0400, Bai Shen wrote:
>
> Hi there,
>
> > I got my error page to show up. However, the css and image files don't
> > load. I tried changing the location, but that doesn't seem to work.
> >
> > Any suggestions?
>
> Try changing the location again. Maybe it will work this time.
>
>
> Or alternatively:
>
> Please fill in the details:
>
> > > what did you do?
>
> That will be something like "curl -i http://myserver/myfile.css"
>
> > > what did you see?
>
> That will be whatever you got back -- the content of /var/tmp/myfile.css,
> or the content of another file, or some error message. There might be
> more details available in log files.
>
> > > what did you expect to see?
>
> That will be something like "http 200 and the content of
> /usr/local/nginx/html/myfile.css".
>
> > > and the more specific you are, the easier it will be for someone else
> to
> > > reproduce the problem you are reporting.
>
> Provide the relevant part of nginx.conf from a machine where you saw
> the problem. If you don't know what is the relevant part, provide the
> whole thing.
>
> It doesn't have to be your "live" config, but it should be a config that
> you ran on a test machine. The smaller the config, the better.
>
> If you make it easy for someone to run the same server config as you,
> and run the same client commands as you, and see the same error output
> as you; then you make it easy for that person to try to help resolve the
> problem you saw.
>
> If you don't, you don't.
>
> f
> --
> Francis Daly francis@daoine.org
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Custom error pages

Bai Shen March 13, 2012 09:40AM

Re: Custom error pages

Francis Daly March 13, 2012 07:42PM

Re: Custom error pages

Bai Shen March 14, 2012 08:52AM

Re: Custom error pages

Bai Shen March 15, 2012 10:50AM

Re: Custom error pages

Francis Daly March 15, 2012 03:26PM

Re: Custom error pages

Bai Shen March 16, 2012 09:36AM

Re: Custom error pages

Bai Shen March 16, 2012 09:44AM

Re: Custom error pages

Francis Daly March 16, 2012 11:20AM

Re: Custom error pages

Bai Shen March 16, 2012 02:28PM

Re: Custom error pages

Bai Shen March 28, 2012 03:44PM

Re: Custom error pages

Francis Daly March 28, 2012 05:18PM

Re: Custom error pages

Bai Shen April 03, 2012 04:14PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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