2017-12-28 140 views
9

जीजीपी में Portus को एनजीएक्सएक्स इंजेक्शन लोड बैलेंसर के साथ लागू किया गया। पोर्टस भार अप ठीक, लेकिन जब अनुप्रयोग का उपयोग और रूपों मैं निम्नलिखित त्रुटि मिलती है में से कुछ को भरने की कोशिश कर रहा:रेल ऐप के लिए क्यूबर्नेट में मिश्रित सामग्री त्रुटि nginx ingress

VM798:1 Mixed Content: The page at ' https://staging.foo.bar/admin/registries/new ' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint ' http://staging.foo.bar//api/v1/registries/validate?name=devreg&hostname=staging-foo-barregistry%3A5000&external_hostname=&use_ssl=false&force=false&only%5B%5D=hostname '. This request has been blocked; the content must be served over HTTPS.

Nginx विन्यास: https://github.com/kubic-project/caasp-services/blob/master/contrib/helm-charts/portus/templates/nginx-configmap.yaml

पर्यावरण:

  • में Kubernetes जीसीपी
  • हेल्म
  • एसएसएल के माध्यम से तैनात सभी संसाधन क्यूब-लेगो
  • द्वारा प्रदान किया गया है अंगूर एपीआई मणि
  • अंगूर के साथ
  • रेल एप्लिकेशन एपीआई के रूप में निम्नानुसार mounts: mount API::RootAPI => "/"

तो मैं मैनुअल http कॉल के लिए कोड की जांच सुनिश्चित कर दिया है और कुछ भी नहीं देखा था। और मैंने एक दिन अब रेल डॉक्स और nginx दस्तावेज़ों के माध्यम से खोदने की कोशिश की है ताकि कुछ ऐप एसएसएल और एपीआई के साथ ठीक से लोड हो सकें, उसी नियम का पालन न करने के लिए

----- अपडेट 1 ------ आगे की जांच के बाद, ऐसा लगता है कि इसमें वू सत्यापनकर्ता के साथ कुछ करना है।

curl ' http://staging.foo.bar//api/v1/registries/validate?name=devreg&hostname=st&external_hostname=&use_ssl=false&force=false&only%5B%5D=name ' -X OPTIONS -H 'Access-Control-Request-Method: GET' -H 'Origin: https://staging.foo.bar ' -H 'Access-Control-Request-Headers: x-csrf-token' --compressed

और यह जड़ यूआरएल यहाँ बुलाया जा रहा है की तरह लग रहा: जैसा कि ऊपर उल्लेख

javascript: 
     window.API_ROOT_URL = '#{root_url}'; 

root_url/पर सेट है डेवलपर उपकरण जाँच हो रही है निम्नलिखित का पता चला।

हालांकि, विश्लेषण करने Vue कोड करीब revels:

Vue.http.options.root = window.API_ROOT_URL; 

Vue.http.interceptors.push((_request, next) => { 
    window.$.active = window.$.active || 0; 
    window.$.active += 1; 

    next(() => { 
    window.$.active -= 1; 
    }); 
}); 

Vue.http.interceptors.push((request, next) => { 
    if ($.rails) { 
    // eslint-disable-next-line no-param-reassign 
    request.headers.set('X-CSRF-Token', $.rails.csrfToken()); 
    } 
    next(); 
}); 

// we are not a SPA and when user clicks on back/forward 
// we want the page to be fully reloaded to take advantage of 
// the url query params state 
window.onpopstate = function (e) { 
    // phantomjs seems to trigger an oppopstate event 
    // when visiting pages, e.state is always null and 
    // in our component we set an empty string 
    if (e.state !== null) { 
    window.location.reload(); 
    } 
}; 

Vue.config.productionTip = process.env.NODE_ENV !== 'production'; 

पैरामीटर क्वेरी

params do 
      requires :name, 
        using: API::Entities::Registries.documentation.slice(:name) 
      requires :hostname, 
        using: API::Entities::Registries.documentation.slice(:hostname) 
      optional :external_hostname, 
        using: API::Entities::Registries.documentation.slice(:external_hostname) 
      requires :use_ssl, 
        using: API::Entities::Registries.documentation.slice(:use_ssl) 
      optional :only, type: Array[String] 
     end 

उत्तर

2

में SSL का उपयोग करने मैं अपने ऐप के कार्यों के बारे में यकीन नहीं है, और यांत्रिकी सेट कर रहे हैं किस डेटा को पास किया जा रहा है, लेकिन मुझे संदेह है कि आपको use_ssl=true को /validate एंडपॉइंट पर क्वेरीस्ट्रिंग पैरामीटर में पास करने की आवश्यकता हो सकती है।

वर्तमान में, use_ssl=false पारित किया जा रहा है, जो संभवतः एक गैर-एसएसएल प्रतिक्रिया लौटा रहा है।

+0

उपयोग_एसएसएल को पैरा में बुलाया जा रहा है और यह अभी भी काम नहीं करना प्रतीत होता है – niharvey

संबंधित मुद्दे