2017-10-20 12 views
1
에 CSS와 JS 관련 내용을로드하는 데 실패 난 그냥 nginx를 가진 역방향 프록시를 구성하고 5.7

Sonarqube는 Centos7

mysql을 가진 VM에 sonarqube 5.6.7 (센트 OS 7을) 설치

전에서 sonarqube에 액세스 할 때 내 webrowser I없이 CSS로 홈페이지를 얻을 :

GET http://serveur.url.com/css/sonar.css?v=5.6.7 net::ERR_ABORTED 
GET http://serveur.url.com/js/bundles/vendor.js?v=5.6.7 net::ERR_ABORTED 
GET http://serveur.url.com/js/bundles/sonar.js?v=5.6.7 net::ERR_ABORTED 
GET http://serveur.url.com/js/bundles/dashboard.js?v=5.6.7 net::ERR_ABORTED 
GET http://serveur.url.com/js/bundles/widgets.js?v=5.6.7 net::ERR_ABORTED 
GET http://serveur.url.com/js/bundles/main.js?v=5.6.7 net::ERR_ABORTED 
GET http://serveur.url.com/images/loading-small.gif 404 (Not Found) 
GET http://serveur.url.com/js/bundles/vendor.js?v=5.6.7 net::ERR_ABORTED 
GET http://serveur.url.com/js/bundles/sonar.js?v=5.6.7 net::ERR_ABORTED 
GET http://serveur.url.com/js/bundles/dashboard.js?v=5.6.7 net::ERR_ABORTED 
GET http://serveur.url.com/js/bundles/widgets.js?v=5.6.7 net::ERR_ABORTED 
Failed to load resource: the server responded with a status of 404 (Not Found) 

Uncaught ReferenceError: SonarWidgets is not defined 
    at (index):237 
    at (index):256 
11:13:28.860 (index):280 Uncaught ReferenceError: jQuery is not defined 
    at (index):280 

GET http://serveur.url.com/js/bundles/main.js?v=5.6.7 404 (Not Found) 

어떤 생각이 왜이 발생하는됩니다 :

[hide] 
    [hide] 
    [hide] 
    Home 

Welcome to SonarQube Dashboard 
Since you are able to read this, it means that you have successfully started 
your SonarQube server. Well done! 

그리고 콘솔에서

?

편집 :

구성의 nginx :

server { 
     listen  80 default_server; 
     listen  [::]:80 default_server; 
     #server_name _; 
     server_name serveur.url.com; 
     root   /usr/share/nginx/html; 

     # Load configuration files for the default server block. 
     include /etc/nginx/default.d/*.conf; 

     #Node Room chat dev 
     location/{ 
      proxy_pass http://127.0.0.1:3100; 
      proxy_http_version 1.1; 
      proxy_set_header Upgrade $http_upgrade; 
      proxy_set_header Connection 'upgrade'; 
      proxy_set_header Host $host; 
      proxy_cache_bypass $http_upgrade; 
     } 

     location ~ \.css { 
      add_header Content-Type text/css; 
     } 
     location ~ \.js { 
      add_header Content-Type application/x-javascript; 
     } 

     location ^~/jenkins/ { 
      proxy_redirect off; 
      proxy_pass http://127.0.0.1:7001/jenkins/; 
      proxy_http_version 1.1; 
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
      proxy_set_header Host $http_host; 
     } 

     location ^~/sonar/ { 
         proxy_pass http://127.0.0.1:9000/; 
         proxy_http_version 1.1; 
         proxy_set_header Upgrade $http_upgrade; 
         proxy_set_header Connection 'upgrade'; 
         proxy_set_header Host $host; 
         proxy_cache_bypass $http_upgrade; 
     } 
     error_page 404 /404.html; 
         location = /40x.html { 
        } 

        error_page 500 502 503 504 /50x.html; 
         location = /50x.html { 
        } 

구성 소나 (LTS 버전) :

sonar.jdbc.username=sonar 
sonar.jdbc.password=password 

# Mysql 5.7 
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance 
sonar.jdbc.maxActive=10 
sonar.jdbc.maxIdle=5 
sonar.jdbc.minIdle=2 
sonar.jdbc.maxWait=5000 
sonar.jdbc.minEvictableIdleTimeMillis=600000 
sonar.jdbc.timeBetweenEvictionRunsMillis=30000 

#Web server 
sonar.web.javaOpts=-Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true 
sonar.web.host=server 
sonar.web.context=/sonar 

편집 2 : 나는의 nginx 설정을 변경하면

나는 이런 종류의를 얻을 수 오류 :

당신의 sonar.properties 파일에 따르면3210
org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- active_support/string_inquirer 
    at Module.env(/export/softwares/sonarqube/web/WEB-INF/gems/gems/rails-2.3.15/lib/initializer.rb:56) 
    at ActionController::Failsafe.call(/export/softwares/sonarqube/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/failsafe.rb:29) 
    at ActionController::Failsafe.call(/export/softwares/sonarqube/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/failsafe.rb:26) 
    at ActionController::Dispatcher.call(/export/softwares/sonarqube/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/dispatcher.rb:106) 
    at Rack::Adapter::Rails.serve_rails(file:/export/softwares/sonarqube/lib/server/jruby-rack-1.1.13.2.jar!/rack/adapter/rails.rb:34) 
    at Rack::Adapter::Rails.call(file:/export/softwares/sonarqube/lib/server/jruby-rack-1.1.13.2.jar!/rack/adapter/rails.rb:39) 
    at Rack::Handler::Servlet.call(file:/export/softwares/sonarqube/lib/server/jruby-rack-1.1.13.2.jar!/rack/handler/servlet.rb:22) 
+0

nginx 구성 및 sonar.properties 파일을 게시 할 수 있습니까? –

+0

내 질문을 편집했습니다. –

답변

1

, 당신이 당신의 nginx 구성 파일에 /sonar

그러나 웹 컨텍스트를 사용하는 경우 설정 :

location ^~/sonar/ { 
       proxy_pass http://127.0.0.1:9000/; 

나는 당신이 경우 문제를 해결할 수있을 것이라고 생각 설정 :

location ^~/sonar/ { 
       proxy_pass http://127.0.0.1:9000/sonar/;