static char *
ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
    ngx_http_core_loc_conf_t *clcf = conf;
    u_char                            *p;
    ngx_int_t                          overwrite;
    ngx_str_t                         *value, uri, args;
    ngx_uint_t                         i, n;
    ngx_http_err_page_t               *err;
    ngx_http_complex_value_t           cv;
    ngx_http_compile_complex_value_t   ccv;
    if (clcf->error_pages == NULL) {
        clcf->error_pages = ngx_array_create(cf->pool, 4,
                                             sizeof(ngx_http_err_page_t));
        if (clcf->error_pages == NULL) {
            return NGX_CONF_ERROR;
        }
    }
    value = cf->args->elts;
    i = cf->args->nelts - 2;
    if (value[i].data[0] == '=') {
        if (i == 1) {
            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                               "invalid value \"%V\"", &value[i]);
            return NGX_CONF_ERROR;
        }
        if (value[i].len > 1) {
            overwrite = ngx_atoi(&value[i].data[1], value[i].len - 1);
            if (overwrite == NGX_ERROR) {
                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                                   "invalid value \"%V\"", &value[i]);
                return NGX_CONF_ERROR;
            }
        } else {
            overwrite = 0;
        }
        n = 2;
    } else {
        overwrite = -1;
        n = 1;
    }
    uri = value[cf->args->nelts - 1];
    ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
    ccv.cf = cf;
    ccv.value = &uri;
    ccv.complex_value = &cv;
    if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
        return NGX_CONF_ERROR;
    }
    ngx_str_null(&args);
    if (cv.lengths == NULL && uri.data[0] == '/') {
        p = (u_char *) ngx_strchr(uri.data, '?');
        if (p) {
            cv.value.len = p - uri.data;
            cv.value.data = uri.data;
            p++;
            args.len = (uri.data + uri.len) - p;
            args.data = p;
        }
    }
    for (i = 1; i < cf->args->nelts - n; i++) {
        err = ngx_array_push(clcf->error_pages);
        if (err == NULL) {
            return NGX_CONF_ERROR;
        }
        err->status = ngx_atoi(value[i].data, value[i].len);
        if (err->status == NGX_ERROR || err->status == 499) {
            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                               "invalid value \"%V\"", &value[i]);
            return NGX_CONF_ERROR;
        }
        if (err->status < 300 || err->status > 599) {
            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                               "value \"%V\" must be between 300 and 599",
                               &value[i]);
            return NGX_CONF_ERROR;
        }
        if (overwrite >= 0) {
            err->overwrite = overwrite;
        } else {
            switch (err->status) {
                case NGX_HTTP_TO_HTTPS:
                case NGX_HTTPS_CERT_ERROR:
                case NGX_HTTPS_NO_CERT:
                    err->overwrite = NGX_HTTP_BAD_REQUEST;
                    break;
                default:
                    err->overwrite = err->status;
                    break;
            }
        }
        err->value = cv;
        err->args = args;
    }
    return NGX_CONF_OK;
}
['static char *\nngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)\n{\n    ngx_http_core_loc_conf_t *clcf = conf;\n    u_char                            *p;\n    ngx_int_t                          overwrite;\n    ngx_str_t                         *value, uri, args;\n    ngx_uint_t                         i, n;\n    ngx_http_err_page_t               *err;\n    ngx_http_complex_value_t           cv;\n    ngx_http_compile_complex_value_t   ccv;\n    if (clcf->error_pages == NULL) {\n        clcf->error_pages = ngx_array_create(cf->pool, 4,\n                                             sizeof(ngx_http_err_page_t));\n        if (clcf->error_pages == NULL) {\n            return NGX_CONF_ERROR;\n        }\n    }\n    value = cf->args->elts;\n    i = cf->args->nelts - 2;\n    if (value[i].data[0] == \'=\') {\n        if (i == 1) {\n            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                               "invalid value \\"%V\\"", &value[i]);\n            return NGX_CONF_ERROR;\n        }\n        if (value[i].len > 1) {\n            overwrite = ngx_atoi(&value[i].data[1], value[i].len - 1);\n            if (overwrite == NGX_ERROR) {\n                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                                   "invalid value \\"%V\\"", &value[i]);\n                return NGX_CONF_ERROR;\n            }\n        } else {\n            overwrite = 0;\n        }\n        n = 2;\n    } else {\n        overwrite = -1;\n        n = 1;\n    }\n    uri = value[cf->args->nelts - 1];\n    ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));\n    ccv.cf = cf;\n    ccv.value = &uri;\n    ccv.complex_value = &cv;\n    if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {\n        return NGX_CONF_ERROR;\n    }\n    ngx_str_null(&args);\n    if (cv.lengths == NULL && uri.data[0] == \'/\') {\n        p = (u_char *) ngx_strchr(uri.data, \'?\');\n        if (p) {\n            cv.value.len = p - uri.data;\n            cv.value.data = uri.data;\n            p++;\n            args.len = (uri.data + uri.len) - p;\n            args.data = p;\n        }\n    }\n    for (i = 1; i < cf->args->nelts - n; i++) {\n        err = ngx_array_push(clcf->error_pages);\n        if (err == NULL) {\n            return NGX_CONF_ERROR;\n        }\n        err->status = ngx_atoi(value[i].data, value[i].len);\n        if (err->status == NGX_ERROR || err->status == 499) {\n            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                               "invalid value \\"%V\\"", &value[i]);\n            return NGX_CONF_ERROR;\n        }\n        if (err->status < 300 || err->status > 599) {\n            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                               "value \\"%V\\" must be between 300 and 599",\n                               &value[i]);\n            return NGX_CONF_ERROR;\n        }\n        if (overwrite >= 0) {\n            err->overwrite = overwrite;\n        } else {\n            switch (err->status) {\n                case NGX_HTTP_TO_HTTPS:\n                case NGX_HTTPS_CERT_ERROR:\n                case NGX_HTTPS_NO_CERT:\n                    err->overwrite = NGX_HTTP_BAD_REQUEST;\n                    break;\n                default:\n                    err->overwrite = err->status;\n                    break;\n            }\n        }\n        err->value = cv;\n        err->args = args;\n    }\n    return NGX_CONF_OK;\n}']