【问题标题】:how i cant configure a domain by ejabberd, replace localhost:5280/admin?我如何无法通过 ejabberd 配置域,替换 localhost:5280/admin?
【发布时间】:2018-06-04 15:14:25
【问题描述】:

我如何用http://server.com:5280/admin 替换为domian http://localhost:5280/admin。在我的配置中,首先使用 localhost:5280/admin 登录

我无法打开我的文件 ejabberd.yml

//服务的主机名

hosts:
  - "server.com"

在文件 hosts.conf 中开启

// localhost 名称解析在 DNS 内部处理。

127.0.0.1 localhost
::1 localhost
0.0.0.0 localhost
1.1.1.1 localhost
'##192.168.0.1  server.com (it is my ip local)

关于 IIS urlrewrite 文件 web.conf

<rule name="ReverseProxyInboundRule1" stopProcessing="true"> <match url="xmpp-httpbind" /> <action type="Rewrite" url="http://localhost:5280/bosh/{R:1}" /> </rule>

Strophe 客户端

var connection = null;
var server_dominio = 'server.com';
var BOSH_SERVICE  = '/xmpp-httpbind';

我可以在这个链接https://github.com/jsxc/jsxc/issues/353@skyfox675 中搜索可能的解决方案,但是 HTTP 错误 500.50 - URL 重写模块错误。 应用程序“默认网站/应用程序”中的服务器错误 不允许设置服务器变量“ORIGINAL_HOST21”。将服务器变量名称添加到允许的服务器变量列表中。

我只编辑了 web.config 文件

【问题讨论】:

标签: iis web-config localhost ejabberd strophe


【解决方案1】:

在此链接步骤中配置服务器变量:How to add a server variable in IIS

配置文件主机

127.0.0.1 localhost
::1 localhost
0.0.0.0 localhost
1.1.1.1 localhost
192.168.0.1  server.com 

关于 IIS urlrewrite 文件 web.conf

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <httpProtocol>
            <customHeaders>
                <add name="Access-Control-Allow-Origin:" value="*" />
                <add name="Access-Control-Max-Age" value="86400" />
                <add name="Access-Control-Allow-Headers" value="Content-Type" />
                <add name="Access-Control-Allow-Methods" value="POST, GET, OPTIONS" />
            </customHeaders>
        </httpProtocol>
        <rewrite>
            <rules>
                <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                    <match url="^http-bind/" />
                    <conditions>
                        <add input="{CACHE_URL}" pattern="^(https?)://" />
                    </conditions>
                    <action type="Rewrite" url="http://server.com:5280/http-bind" logRewrittenUrl="true" />
                    <serverVariables>
                        <set name="HTTP_ACCEPT_ENCODING" value="" /> 
                    </serverVariables>
                </rule>
            </rules>
            <outboundRules>
                <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
                    <match filterByTags="A, Form, Img" pattern="^/(.*)" />
                    <action type="Rewrite" value="/server.com/{R:1}" />
                </rule>
                <preConditions>
                    <preCondition name="ResponseIsHtml1">
                        <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
                    </preCondition>
                </preConditions>
            </outboundRules>
        </rewrite>
    </system.webServer>
</configuration>

Strophe 客户端

var connection = null;
var server_dominio = 'server.com';
var BOSH_SERVICE  = 'http://192.168.0.1:5280/http-bind';

【讨论】:

    猜你喜欢
    • 2016-02-03
    • 1970-01-01
    • 2019-06-09
    • 2018-01-10
    • 1970-01-01
    • 2020-12-12
    • 2014-08-29
    • 1970-01-01
    • 2016-09-16
    相关资源
    最近更新 更多