首页 > 解决方案 > 为什么在社交媒体上从我的网站共享链接时会显示本地 IP 地址?

问题描述

为什么在社交媒体上从我的网站共享链接时会显示本地 IP 地址?我正在托管我的本地计算机 OS-Windows 10、IIS、反向代理的 odoo11 平台

看起来像这样

看起来像这样看图片here

标签: windows-10iis-7.5reverse-proxyodoo-11

解决方案


看起来你只设置了 iis 反向代理入站规则,它只重写你的页面。要重写您的页面图像、链接等内容,您需要使用出站规则:

<rewrite>
        <rules>
            <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                <match url="(.*)" />
                <action type="Rewrite" url="http://192.168.2.51/{R:1}" />
            </rule>
        </rules>
        <outboundRules>
            <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
                <match filterByTags="A, Form, Img" pattern="^http(s)?://192.168.2.51/(.*)" />
                <action type="Rewrite" value="http{R:1}://www.example.com/{R:2}" />
            </rule>
            <preConditions>
                <preCondition name="ResponseIsHtml1">
                    <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
                </preCondition>
            </preConditions>
        </outboundRules>
    </rewrite>

推荐阅读