我如何通过ejabberd配置域名,替换localhost:5280 / admin?

时间:2018-06-04 15:14:26

标签: iis web-config localhost ejabberd strophe

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

我无法查看我的文件ejabberd.yml

// SERVED HOSTNAMES

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重写模块错误。 应用程序“DEFAULT WEB SITE / aplications”中的服务器错误 不允许设置服务器变量“ORIGINAL_HOST21”。将服务器变量名称添加到允许的服务器变量列表中。

我只编辑文件web.config

1 个答案:

答案 0 :(得分:0)

在此链接步骤中配置服务器变量: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';