2017-02-26 33 views
4

昨天在ubuntu 16.04上安裝了一個新的gitlab 8.17.0安裝,並將它配置爲像我記錄的那個舊的。我正在運行一個允許作爲代理加密的apache2。它看起來好像一切運行良好,但幾個JS文件沒有加載。我得到 「422無法處理的實體」 HTTPS在422無法處理的實體,JS文件,gitlab 8.17,apache ssl

  • 域/資產/的WebPack /應用XXX.js
  • 域/資產/的WebPack/lib_dX.js
  • 域/資產/的WebPack /用戶-X的.js
  • 域/資產/的WebPack/lib_d3-X.js
  • 域/資產/的WebPack /用戶-X.js

/etc/gitlab/gitlab.rb

external_url 'https://gitlab.example.com' 

nginx['listen_address'] = 'localhost' 
nginx['listen_port'] = 8080 
nginx['listen_https'] = false 

web_server['external_users'] = ['www-data'] 
nginx['enable'] = false 

/etc/apache2/sites-available/gitlab.example.com.conf

<VirtualHost *:80> 
     ServerName gitlab.example.com 
     ServerAdmin [email protected] 

     ErrorLog /var/log/apache2/gitlab.example.com/error.log 
     CustomLog /var/log/apache2/gitlab.example.com/access.log combined 

     Redirect 301/https://gitlab.example.com/ 
</VirtualHost> 

<VirtualHost *:443> 
     ServerName gitlab.example.com 
     ServerAdmin [email protected] 

     ErrorLog /var/log/apache2/gitlab.example.com/error.log 
     CustomLog /var/log/apache2/gitlab.example.com/access.log combined 

     RequestHeader set X-Forwarded-Proto "https" 
     RequestHeader set X-Forwarded-Port "443" 
     ProxyPreserveHost On 
     ProxyPass/http://localhost:8080/ 
     ProxyPassReverse/http://localhost:8080/ 

     SSLEngine on 
     SSLCertificateFile /etc/letsencrypt/live/gitlab.example.com/cert.pem 
     SSLCertificateKeyFile /etc/letsencrypt/live/gitlab.example.com/privkey.pem 
     SSLCertificateChainFile /etc/letsencrypt/live/gitlab.example.com/chain.pem 

    <Proxy http://localhost:8080/> 
    Order deny,allow 
    Allow from all 
    </Proxy> 
</VirtualHost> 

有沒有人有想法來解決這個問題?

謝謝!我祝你週日愉快。

回答

1

我與服務提到的靜態文件,但在nginx代理後面有同樣的問題。在/var/log/gitlab/gitlab-rails/production.log文件存在錯誤:

Started GET "/assets/webpack/application-0b895f7016d93748393a-v2.js" for 127.0.0.1 at 2017-03-05 11:14:21 +0100 
Processing by ApplicationController#route_not_found as JS 
    Parameters: {"unmatched_route"=>"assets/webpack/application-0b895f7016d93748393a-v2"} 
Security warning: an embedded <script> tag on another site requested protected JavaScript. 
If you know what you're doing, go ahead and disable forgery protection on this action to 
permit cross-origin JavaScript embedding. 
Completed 422 Unprocessable Entity in 28ms (ActiveRecord: 1.8ms) 

ActionController::InvalidCrossOriginRequest (Security warning: an embedded 
<script> tag on another site requested protected JavaScript. If you know 
what you're doing, go ahead and disable forgery protection on this action to 
permit cross-origin JavaScript embedding.): 
    lib/gitlab/middleware/multipart.rb:93:in `call' 
    lib/gitlab/request_profiler/middleware.rb:14:in `call' 
    lib/gitlab/middleware/go.rb:16:in `call' 

的/ opt/gitlab /嵌入式/服務/ gitlab護欄所以我修改/配置/環境/ production.rb

config.action_controller.allow_forgery_protection = false 

    # Disable Rails's static asset server (Apache or nginx will already do this) 
    config.serve_static_files = true 

並重新啓動gitlab(gitlab-CTL重啓)。現在,它的工作原理,但我想我的服務器的安全性被削弱。

+0

恭喜。我重新安裝舊版本的gitlab。這是我的解決方案。現在一切都很好。另請參閱此問題:https://gitlab.com/gitlab-org/omnibus-gitlab/issues/2021 – Phillip

0

這是8.17版本中尚未解決的問題。

只需降級到8.16 sudo apt-get install gitlab-ce=8.16.6-ce.0

相關問題