自定义nginx错误页,用于;SSL证书错误";
如果客户选择过期证书,nginx服务器将显示内置错误页面自定义nginx错误页,用于;SSL证书错误";,ssl,nginx,ssl-certificate,client-certificates,Ssl,Nginx,Ssl Certificate,Client Certificates,如果客户选择过期证书,nginx服务器将显示内置错误页面 <html> <head><title>400 The SSL certificate error</title></head> <body bgcolor="white"> <center><h1>400 Bad Request</h1></center> <center>The SSL certifica
<html>
<head><title>400 The SSL certificate error</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<center>The SSL certificate error</center>
<hr><center>nginx</center>
</body>
</html>
400 SSL证书错误
400错误请求
SSL证书错误
nginx
如何捕获错误并向客户端显示不同的页面?请参阅
为代码400定义错误页将不起作用。工作方法是
server {
...
error_page 495 496 497 https://www.google.com;
...
}
因此,未能提交有效证书的用户将被重定向到google.com。当ssl\u verify\u client
设置为on
或optional
时,这将起作用
另一种方法仅当
$ssl\u-verify\u-client
设置为optional
时有效,您可以使用$ssl\u-client\u-verify
进行重定向
if ($ssl_client_verify = NONE) {
return 303 https://www.google.com;
}
当
$ssl\u verify\u client
设置为on
时,它将不起作用。有一种方法可以向客户端显示不同的页面。您这样做的方式基本上与上述相同,但您将google网站更改为您创建的页面:
server {
...
error_page 495 496 497 /error400.html;
...
}
只需确保在每个服务器实例中包含所有自定义页面。是否检查了文档?谢谢。我处理了代码400,事实上,有必要处理其他错误代码。