Unable to connect to remote server from Hawtio dashboard

If you are using the runnable JAR version of Hawtio you can pass the parameter hawtio.proxyWhitelist also when starting the application:

java -Dhawtio.proxyWhitelist=SERVERNAME -jar hawtio-app-1.5.3.jar

From 2.10.1 on: Use hawtio.proxyAllowlist instead of hawtio.proxyWhitelist. (Thanks rastadrian for pointing it out.)


Since hawtio 1.5.0 you need to add remote hosts to the hawtio.proxyWhitelist system property.

http://hawt.io/docs/configuration/#configuration-properties

hawtio.proxyWhitelist - Comma-separated whitelist for target hosts that the hawtio-jmx Connect plugin can connect to via ProxyServlet (default localhost, 127.0.0.1). All hosts that are not listed in this whitelist are denied to connect for security reasons. This option can be set to * to restore old behavior and whitelist all hosts. Prefixing an element of the list with "r:" allows to define a regexp (example: localhost,r:myservers[0-9]+.mydomain.com)

If you are using hawtio.war then modify its WEB-INF/web.xml like this:

  <servlet>
    <servlet-name>jolokia-proxy</servlet-name>
    <servlet-class>io.hawt.web.ProxyServlet</servlet-class>
    <!--
      Comma-separated list of allowed target hosts. It is required for security.
      '*' allows all hosts but keep in mind it's vulnerable to security attacks.
    -->
    <init-param>
      <param-name>proxyWhitelist</param-name>
      <param-value>
        localhost,
        127.0.0.1,
        remote-server-1
      </param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>