gpt4 book ai didi

azure - 我需要更改 Azure 应用服务中的哪些设置才能允许在 App_Offline 中使用 Base64 图像?

转载 作者:行者123 更新时间:2023-12-03 00:22:45 24 4
gpt4 key购买 nike

我目前有一个运行良好的 App_Offline.htm 文件。当它位于网站的根目录时,所有用户都会被强制访问 App_Offline.htm 页面,并且会阻止应用程序加载。

我们正在添加一些动画和图像,在 App_Offline.htm 中执行此操作的唯一正确方法是使用内联的 base64 图像。

在我添加此内容的那一刻(请注意,我缩短了帖子的 base64),如果我直接转到浏览器中的文件,它就可以工作,但 IIS/Azure/App Service 不会自动强制用户访问该页面并阻止像平常一样的应用程序。

      .image2 {
width: 57px;
height: 54px;
background-image: url(data:image/png;base64,iVBOR.....rkJggg==);
}

我认为有一些内容安全设置或我需要添加的内容。即使页面加载正确,当页面具有 Base64 图像时,是什么阻止 IIS/应用服务强制每个人访问该页面?

除非有文件大小限制,否则当前为 2896 KB,但根据研究,似乎没有限制。

最佳答案

通常,当您的应用程序根目录中有 app_offline.htm 文件时,您的 Web 应用程序将被关闭,所有请求将被定向到 app_offline.html 页面。

所以你有两种方法,

  1. 您可以在app_offline.htm中编写.image2相关代码

  2. 将.css放在其他网站上,或使用其他地址访问文件。

相关帖子

Add css style sheet to app_offline

隐私

更多详情,可以引用我的示例代码,只需替换base64图片代码即可。

我的测试结果。

enter image description here

<!DOCTYPE html>
<html>
<head>
<style type="text/css">
@font-face {
font-family: "Open Sans";
font-style: normal;
font-weight: 400;
src: local("Segoe UI"), local("Open Sans"), local("OpenSans"), url(https://themes.googleusercontent.com/static/fonts/opensans/v6/K88pR3goAWT7BTt32Z01mz8E0i7KZn-EPnyo3HZu7kw.woff) format('woff');
}

body {
font-family: "Open Sans";
}

h1 {
font-size: 90px !important;
}

.error-page-container {
color: #333333;
margin: 50px auto 0;
text-align: center;
width: 600px;
}

.error-page-container h1 {
font-size: 120px;
font-weight: normal;
line-height: 120px;
margin: 10px 0;
font-family: "Open Sans";
}

.error-page-container h2 {
border-bottom: 1px solid #CCCCCC;
color: #666666;
font-size: 18px;
font-weight: normal; /*text-transform: uppercase;*/
font-family: "Open Sans";
}

.error-page-container a {
text-decoration: none;
color: #ffffff;
background-color: #009AD7;
padding: 11px 19px;
}

.error-page-container a:hover {
text-decoration: none;
}

.image2 {
width: 500px;
height: 300px;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgMAAACOCAYAAACsagt4AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAABmfSURBVHhe7Z09rtzI1Ya1hW9PXsEFJvcKvAjhBoZDJ4YWcK+TSQxBiWNJEzgwJlJkOPAY8sw48wL6Y/2fc+qHZLPZ6m4+D0BA/Dt1qtiq961i3+o3JwAAADg0mAEAAICDgxkAAAA4OJgBAACAg4MZAAAAODiYAQAAgIODGQAAADg4mAEAAICD0zUDP//8c/wXAAAAPDKYAQAAgIODGQAAADg4mAG4Gz6/fXN68+bp9PKveOCb8/n0fI18fnie6n1rdQeARwIzAFfi6+nluzen5x/i7hncoxkIOcftu5epFdbiynhzenpdfycAwFIwA3AltpuB22PGDLgR/dvPcSfUv+wvxM8KMCMAAPtyx2Ygdq5p1KU62SI8ZWQmOtR/vZye3jxPXXkYdbVGbWpEZzpjd86N1L6+PuVrloqcu8fdK+Pre0297GjS5y7O+83VJSBzkseXou/Xuc2d69VLt2XZ1Gg3T4WHTbWJqrOtk2sv93zEs6yukeca5bo2lmUsFuxoBn4Q9w5G/7791s4OYAYA4ArcrRnwAmNGXaWTL4Kajqnrc8efOtkgFkmAbKcdRLAITBa3GG9NJx9iiVx9Zy/F/Fl0/O166XuFUFSx1omPrafCxLZl23rVZYfclchnpvaXAmzLSmQTJ0nPOuUy02auLPGsQ1nu/hjXl7FUfJPJSDmZ2Ia1z8Nj2hkAYA/u1Ay4TteIgus0c0cbBcIKTDofzYDstJ3AB8FodehayLwZkJ16U6TaeEGQefny+p29ur4SKp2ry0vnPY6tadU7YQU1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ycGzYD5e/e23/rDwAAAJfg5mcGwuI8LIoCAACwF7f/miCuWsfsAAAAwD5gBgAAAA4OZgAAAODg3L4ZSF8kvNZP4gIAAByMOzADAf+DKnyREAAA4OLczczAbf0SHgAAwOPAdwYAAAAODmYAAADg4GAGAAAADs7tmwH/W/l8cRAAAGAvbtgMlN8m4MuDAAAA+3H7MwMAAACwK10zAAAAAMcAMwAAAHBwMAMAAAAHBzMAAABwcDADAAAABwczAAAAcHAwAwAAAAcHMwAAAHBwMAMAAAAHBzMAAABwcDADAAAABwczAAAAcHAwAwAAAAcHMwAAAHBwMAMAAACH5nT6f+plarTjY48AAAAAAElFTkSuQmCC');
}
</style>


<title>
Under Maintenance
</title>
</head>
<body>
<div class="error-page-container">
<h1>Maintenance</h1>
<div class="image2" src="" alt="test">
</div>
<h2>
<p>Website is under maintenance right now. It will be back in few minutes.</p>
</h2>
<br />
<a href="/">Try again</a>
</div>
</body>
</html>

关于azure - 我需要更改 Azure 应用服务中的哪些设置才能允许在 App_Offline 中使用 Base64 图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65778213/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com