IIS中的反向代理上的SonarQube拒绝执行脚本

问题描述 投票:0回答:1

我有使用Apache Tomcat的Sonar Qube服务器和在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个回答
1
投票

看起来反向代理的设置不正确,因为JavaScript文件的mimetypes不正确。

你能删除覆盖mime类型的配置吗?应保留SonarQube发送的那个。

© www.soinside.com 2019 - 2024. All rights reserved.