小编Haz*_*nko的帖子

IIS重写规则在实时环境中不起作用

我有8台服务器,3台负载均衡,第4台仅用于CMS.

已为主网站添加SSL证书,但不为CMS所在的sobdomain添加SSL证书.

我写了一条规则,应该找到任何不包含"后台"的网址,并匹配任何其他网页以将其更改为https.

这适用于regexr.com但由于某种原因不起作用

<rewrite>
        <rules>
            <rule name="http to https" stopProcessing="true">
                <match url="(https?:\/\/(?!backoffice).*)" />
                <conditions>
                    <add input="{HTTPS}" pattern="^OFF$" />
                </conditions>
                <action type="Redirect" url="https://www.WEBSITENAME.com{R:1}" />
            </rule>
        </rules>
    </rewrite>
Run Code Online (Sandbox Code Playgroud)

所有4台服务器上都安装了Url Rewriting 2.1,我已经为https创建了天蓝色的负载平衡.

手动转到https工作正常(与负载平衡).

附加信息:

我已经尝试了很多规则,包括现有的答案.我可以看到发生的事情,比如将资产作为https引入,但页面本身不会重定向.

有2个负载均衡集,一个用于端口80,另一个用于端口443.我不知道这是否是核心,或者可能是重定向未发生的潜在原因.

regex iis url-rewriting azure

8
推荐指数
2
解决办法
642
查看次数

压缩 Azure Blob 存储中已有的图像

我接手了一个项目,正在尝试优化一些已经存在的东西。当前最大的问题之一是所提供的图像不是最佳的。存储中有 80,000 多个图像,我一直在寻找一个可以循环遍历所有图像、压缩图像并覆盖旧文件的脚本。

我必须承认,当涉及到 powershell 时,我完全不成熟。

这是我发现的:

https://automys.com/library/asset/azure-blob-storage-image-bulk-optimization

虽然此脚本成功地优化了图像,但它并没有将图像放回正确的位置。它将它放入 blob 容器的根目录中。

我已经报告了这个问题,但没有回应。

有没有人能够帮助我,这样当它重新保存图像时,它应该去哪里?

剧本:

<#
    .SYNOPSIS
        Optimizes image file size for all PNG and JPG images in a Microsoft Azure blob storage
        container by processing them locally and replacing their content with the optimized result.

    .DESCRIPTION
        Image files are often needlessly oversized and can be compressed without quality loss using
        widely-available utilities. Microsoft Azure provides a blob storage service that can be used
        to host publicly-accessible images for websites or …
Run Code Online (Sandbox Code Playgroud)

powershell optimization azure azure-storage-blobs

4
推荐指数
1
解决办法
1806
查看次数