从外部地址访问管理 Web 控制台

Access management web console from external address

使用 http://localhost:8161/console and http://127.0.0.1:8161/console works, but with http://10.0.2.15:8161/console 访问管理控制台时挂起。

netstat -nlt tcp6 0 0 :::8161 :::* 听

在 bootstrap.xml 上有:

<web bind="http://0.0.0.0:8161" path="web">

在 jolokia-access.xml 我尝试了很多连击都没有成功:

<restrict>
    <!-- tried with and without
    <cors> 
        <allow-origin>*://10.0.2.15*</allow-origin>
        <allow-origin>*://10.0.2.15:8161</allow-origin>
        <allow-origin>*://*</allow-origin>
        <strict-checking/>
    </cors> 
    -->
</restrict>

我 运行 它在 xubuntu VM 上的 virtualbox 中。我在这里错过了什么?

telnet 10.0.2.15 8161:

Trying 10.0.2.15...
Connected to 10.0.2.15.
Escape character is '^]'.
GET /console
HTTP/1.1 400 HTTP/0.9 not supported
Content-Type: text/html;charset=iso-8859-1
Content-Length: 65
Connection: close

<h1>Bad Message 400</h1><pre>reason: HTTP/0.9 not supported</pre>Connection closed by foreign host.

远程登录 10.0.2.15 8161

Trying 10.0.2.15...
Connected to 10.0.2.15.
Escape character is '^]'.
GET /console HTTP/1.0
HANGS

发布后

curl -v http://10.0.2.15:8161/console/ -H "Host: localhost:8161"
 Trying 10.0.2.15...
 TCP_NODELAY set
 Connected to 10.0.2.15 (10.0.2.15) port 9999 (#0)
 GET http://10.0.2.15:8161/console/ HTTP/1.1
 Host: localhost:8161

发现是我在 9999 上的本地代理 运行 导致了这个问题。