Nginx自定义错误页面无效

时间:2015-02-25 08:44:39

标签: nginx config

我有以下配置:

# default server
server {
    listen 443 ssl spdy default deferred;
    server_name *.domain.com;

    ssl_certificate_key /path/domain.pem;
    ssl_certificate /path/domain.crt;
    ssl_session_cache shared:SSL:50m;
    # ssl block...

    add_header Strict-Transport-Security 'max-age=31536000; includeSubdomains;';

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;

    location = /404.html {
        root /var/www/default;
    }

    location = /50x.html {
        root /var/www/default;
    }

}

# redirect all http traffic to https
server {
    listen 80;
    server_name *.domain.com;
    return 301 https://$host$request_uri;
}

当我访问https://a.domain.com/404时,它仍会显示nginx默认的404页面。

关于为什么的任何想法?

0 个答案:

没有答案