Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to use Nginx as a simple reverse proxy, but if the server behind Nginx is down I just was to display a blank page. For some reason this configuration isn't displaying a blank page on error 502 and I can't figure out why.

user www-data;
worker_processes  1;

error_log  /var/log/nginx/error.log;
pid        /var/run/;

events {
    worker_connections  1024;
    use epoll;
    # multi_accept on;

http {

    keepalive_timeout 65;
    proxy_read_timeout 200;

    upstream tornado {

    server {
        listen 80;

        location / {
            error_page 502 = @blank;
            proxy_pass http://tornado;

        location @blank {
            index index.html;
            root /web/blank;
share|improve this question

I believe that "root" is ignored in named locations (@blank). Can't say if this is by design or a bug.

This works for me (0.7.67):

    location / {
        error_page 502 = /blank.html;
        proxy_pass http://tornado;

    location = /blank.html {
        root /foo/bar;
share|improve this answer

Specify "error_page" for whole server, not for "location /"

share|improve this answer
That didn't seem to work. Thanks though. – user55583 Sep 29 '10 at 23:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.