我正在尝试使用express-basic-auth保护我的swagger UI URL,它在nestjs服务器本地工作得很好,但是当我将其上传到我的ubuntu vps时,它使得访问swagger UI页面变得不可能,并且chrome显示此错误
This site can’t be reachedThe web page at http://mydomain/docs might be temporarily down or it may have moved permanently to a new web address.
ERR_TOO_MANY_RETRIES
这是我的实现方式
app.use(
'/docs*',
expressBasicAuth({
challenge: true,
users: {
user: 'password',
},
}),
);
嗯,Chrome 使用此错误消息
This site can’t be reached The web page at HTTP:.. might be temporarily down or it may have moved permanently to a new web address.
作为许多错误的笼统描述,它表明 Chrome 无法与您尝试访问的网站建立连接。
以下是修复此错误的一些步骤:
1 - 检查互联网连接。
2 -
try it on incognito
窗口(如果有效),然后返回 Chrome 并清除浏览器缓存(有时,浏览器中的缓存数据可能会导致访问网站时出现问题)并禁用所有扩展程序
3 - 更改您的 DNS 服务器
4 - 禁用防火墙和防病毒软件。