要为 locahost 或 127.0.0.1 以外的主机名或 IP 地址解锁 Fuse 控制台,请按照以下步骤操作:
在编辑器中打开 $KARAF_HOME/etc/jolokia-access.xml 文件。
通过将 Fuse 控制台添加到 < cors > 部分,注册您要通过 Fuse 控制台访问的主机名或 IP 地址。
例如,若要从 Fuse 控制台访问主机名 0.0.0.3,请添加
*<allow-origin>http://0.0.0.3:*</allow-origin>*
*<allow-origin>http://0.0.0.3:*</allow-origin>*
Copy to ClipboardCopied!Toggle word wrapToggle overflow
如下所示的行:
<!--
Cross-Origin Resource Sharing (CORS) restrictions
By default, only CORS access within localhost is allowed for maximum security.
You can add trusted hostnames in the <cors> section to unlock CORS access from them.
-->
<cors>
<!-- Allow cross origin access only within localhost -->
<allow-origin>http*://localhost:*</allow-origin>
<allow-origin>http*://127.0.0.1:*</allow-origin>
<allow-origin>http://0.0.0.3:*</allow-origin>
<!-- Whitelist the hostname patterns as <allow-origin> -->
<!--
<allow-origin>http*://*.example.com</allow-origin>
<allow-origin>http*://*.example.com:*</allow-origin>
-->
<!-- Check for the proper origin on the server side to protect against CSRF -->
<strict-checking />
</cors>
<!--
Cross-Origin Resource Sharing (CORS) restrictions
By default, only CORS access within localhost is allowed for maximum security.
You can add trusted hostnames in the <cors> section to unlock CORS access from them.
-->
<cors>
<!-- Allow cross origin access only within localhost -->
<allow-origin>http*://localhost:*</allow-origin>
<allow-origin>http*://127.0.0.1:*</allow-origin>
<allow-origin>http://0.0.0.3:*</allow-origin>
<!-- Whitelist the hostname patterns as <allow-origin> -->
<!--
<allow-origin>http*://*.example.com</allow-origin>
<allow-origin>http*://*.example.com:*</allow-origin>
-->
<!-- Check for the proper origin on the server side to protect against CSRF -->
<strict-checking />
</cors>
Copy to ClipboardCopied!Toggle word wrapToggle overflow