<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Arial",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Arial",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=VI link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Arial",sans-serif;color:#1F497D'>Thank you Juan Antonio Osorio!<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Arial",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Arial",sans-serif;color:#1F497D'>With you response, I had fixed this error. I must add more config in nova.conf.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Arial",sans-serif;color:#1F497D'>Here:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Arial",sans-serif;color:#1F497D'>[oslo_middleware]<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Arial",sans-serif;color:#1F497D'>secure_proxy_ssl_header = X-Forwarded-Proto<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Arial",sans-serif;color:#1F497D'>enable_proxy_headers_parsing = true<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Arial",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Arial",sans-serif;color:#1F497D'>Now, I can use nova command normally.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Arial",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Arial",sans-serif;color:#1F497D'><a href="http://prntscr.com/k2oq7o">http://prntscr.com/k2oq7o</a><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Arial",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Arial",sans-serif;color:#1F497D'>Thank you very much.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Arial",sans-serif;color:#1F497D'><o:p> </o:p></span></p><div style='mso-element:para-border-div;border:none;border-bottom:solid windowtext 1.0pt;padding:0in 0in 1.0pt 0in'><p class=MsoNormal style='border:none;padding:0in'><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p></div><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Thanks and Best Regards!<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Nguyen Trong Tan<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Openstack group user VietNam.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Arial",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Arial",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Arial",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Juan Antonio Osorio [mailto:jaosorior@gmail.com] <br><b>Sent:</b> Thursday, July 5, 2018 8:37 AM<br><b>To:</b> Nguyễn Trọng Tấn <nguyentrongtan124@gmail.com><br><b>Cc:</b> Bogdan Katynski <bogdan.katynski@workday.com>; openstack@lists.openstack.org; Lê Quang Long (VDC-IT) <longlq.uct@gmail.com><br><b>Subject:</b> Re: [Openstack] Novaclient redirect endpoint https into http<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Are you using http_to_wsgi_middleware? Gotta enable that in the nova config and make sure its in your paste config.<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Wed, 4 Jul 2018, 20:22 Nguyễn Trọng Tấn, <<a href="mailto:nguyentrongtan124@gmail.com">nguyentrongtan124@gmail.com</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><p class=MsoNormal>Thanks you katynski for response.<br><br>But, I had config Haproxy correctly. Here is my config: <a href="http://prntscr.com/k2ofwv" target="_blank">http://prntscr.com/k2ofwv</a><br><br>And, when I use openstack command, that is successful. Here: <a href="http://prntscr.com/k2ogau" target="_blank">http://prntscr.com/k2ogau</a><br><br>I don’t think I config wrong. I can create, delete, list, show any VM with openstack command successfully.<br><br><br><br>Thanks and Best Regards!<br><br>Nguyen Trong Tan<br><br>Openstack group user VietNam.<br><br><br><br>-----Original Message-----<br>From: Bogdan Katynski [mailto:<a href="mailto:bogdan.katynski@workday.com" target="_blank">bogdan.katynski@workday.com</a>] <br>Sent: Wednesday, July 4, 2018 9:50 PM<br>To: Nguyễn Trọng Tấn <<a href="mailto:nguyentrongtan124@gmail.com" target="_blank">nguyentrongtan124@gmail.com</a>><br>Cc: <a href="mailto:openstack-operators@lists.openstack.org" target="_blank">openstack-operators@lists.openstack.org</a>; <a href="mailto:openstack@lists.openstack.org" target="_blank">openstack@lists.openstack.org</a>; Lê Quang Long (VDC-IT) <<a href="mailto:longlq.uct@gmail.com" target="_blank">longlq.uct@gmail.com</a>><br>Subject: Re: [Openstack] Novaclient redirect endpoint https into http<br><br><br>>  <br>> But, I can not use nova command, endpoint nova have been redirected from https to http. Here: <a href="http://prntscr.com/k2e8s6" target="_blank">http://prntscr.com/k2e8s6</a> (command: nova –insecure service list)<br><br>First of all, it seems that the nova client is hitting /v2.1 instead of /v2.1/ URI and this seems to be triggering the redirect.<br><br>Since openstack CLI works, I presume it must be using the correct URL and hence it’s not getting redirected.<br><br>>  <br>> And this is error log: Unable to establish connection to <a href="http://192.168.30.70:8774/v2.1/" target="_blank">http://192.168.30.70:8774/v2.1/</a>: ('Connection aborted.', BadStatusLine("''",))<br>>  <br><br>Looks to me that nova-api does a redirect to an absolute URL. I suspect SSL is terminated on the HAProxy and nova-api itself is configured without SSL so it redirects to an http URL.<br><br>In my opinion, nova would be more load-balancer friendly if it used a relative URI in the redirect but that’s outside of the scope of this question and since I don’t know the context behind choosing the absolute URL, I could be wrong on that.<br><br>I had a similar problem with heat-api running behind an Apache reverse proxy, and managed to resolve it by applying the workaround from this bug report:<br><br><a href="https://bugs.launchpad.net/python-heatclient/+bug/1420907" target="_blank">https://bugs.launchpad.net/python-heatclient/+bug/1420907</a><br><br>Setting<br><br>X-Forwarded-Proto: https <br><br>before forwarding the request to heat-api fixed the issue for me.<br><br>-- <br>Bogdan Katyński<br>freenode: bodgix<br><br><br><br><br><br><br><br>_______________________________________________<br>Mailing list: <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack</a><br>Post to     : <a href="mailto:openstack@lists.openstack.org" target="_blank">openstack@lists.openstack.org</a><br>Unsubscribe : <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack</a><o:p></o:p></p></blockquote></div></div></body></html>