2017-10-20 3 views
1

ich Sonarqube gerade installiert 5.6.7 auf einer VM (Cent os 7) mit MySQL 5.7Sonarqube scheitern css und js bezogene Inhalte auf Centos7 laden

ich einen Reverse-Proxy mit nginx konfiguriert und wenn ich Zugriff auf Sonarqube von meiner unterliegt die ich die Homepage ohne CSS:

[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! 

Und von der Konsole:

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) 

Jede Idee, warum diese auftreten wird?

EDIT:

Config 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 { 
        } 

Config Sonar (LTS-Version):

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 

EDIT 2:

wenn ich nginx Config Ich erhalte diese Art ändern Fehler:

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

Können Sie Ihre nginx-Konfiguration und Ihre Datei sonar.properties posten? –

+0

Ich habe meine Frage bearbeitet –

Antwort

1

Nach Ihrer sonar.properties Datei, die Sie mit einem Web-Kontext /sonar

jedoch in Ihrer nginx Konfigurationsdatei, die Sie einstellen:

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

Ich glaube, Sie in der Lage sein werden, Ihr Problem, wenn Sie zu beheben Set:

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