【问题标题】:SonarQube on reverse proxy in IIS refuses to execute scriptIIS 中反向代理上的 SonarQube 拒绝执行脚本
【发布时间】:2018-05-29 20:42:04
【问题描述】:

我的 Sonar Qube 服务器在 Apache Tomcat 上运行良好,在 IIS 中使用 URL Rewrite 的反向代理。反向代理将域名映射到 Sonar Qube 的 localhost:9000 地址就好了,但是主页中嵌入的 java 脚本文件不运行。在 Chrome 的开发工具中,我收到此错误(在此错误输出中已将公司敏感名称设为通用名称):

Refused to execute script from 'http://sonarqube.company.us/sonar/js/vendor.foo.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
Refused to execute script from 'http://sonarqube.company.us/sonar/js/app.bar.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

我已按照此开发博客文章中的说明进行操作,但无济于事(这是一个 3 部分系列,第 3 部分解决了这个特定问题):https://blogs.msdn.microsoft.com/friis/2016/08/25/iis-with-url-rewrite-as-a-reverse-proxy-part-3-rewriting-the-outbound-response-contents/

以前有没有人遇到过这个问题并解决了?

【问题讨论】:

    标签: iis sonarqube reverse-proxy url-rewrite-module


    【解决方案1】:

    您的反向代理设置似乎不正确,因为 JavaScript 文件的 mimetypes 不正确。

    你能去掉覆盖 mime 类型的配置吗? SonarQube 发送的那个应该被保留。

    【讨论】:

    • 嗨 Eric,你能告诉我如何删除覆盖 mime 类型的配置吗?我遇到了同样的问题,但找不到任何可用的东西。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-27
    • 2018-02-22
    • 2019-09-12
    • 1970-01-01
    • 2020-02-12
    • 2014-09-03
    相关资源
    最近更新 更多