<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Helvetica, sans-serif; color: rgb(32, 31, 30); text-align: left; background-color: rgb(255, 255, 255)">
<font face="Helvetica Neue,arial,sans-serif"><font color="#002000"><font style="background-color: white">Hi all,</font></font></font></div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Helvetica, sans-serif; color: rgb(32, 31, 30); text-align: left; background-color: rgb(255, 255, 255)">
<font face="Helvetica Neue,arial,sans-serif"><font color="#002000"><font style="background-color: white"><span style="margin: 0px; font-family: "Helvetica Neue", arial, sans-serif; color: rgb(0, 32, 0); background-color: white"><br>
</span></font></font></font></div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Helvetica, sans-serif; color: rgb(32, 31, 30); text-align: left; background-color: rgb(255, 255, 255)">
<font face="Helvetica Neue,arial,sans-serif"><font color="#002000"><font style="background-color: white"><span style="margin: 0px; font-size: 14px"><span style="margin: 0px; font-size: 12pt; font-family: "Helvetica Neue", arial, sans-serif; color: rgb(0, 32, 0); background-color: white"><b><u>Question
1</u></b></span></span></font></font></font></div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Helvetica, sans-serif; color: rgb(32, 31, 30); text-align: left; background-color: rgb(255, 255, 255)">
<font face="Helvetica Neue,arial,sans-serif"><font color="#002000"><font style="background-color: white"><span style="margin: 0px; font-size: 14px"><span style="margin: 0px; font-size: 12pt; font-family: "Helvetica Neue", arial, sans-serif; color: rgb(0, 32, 0); background-color: white">Is
it possible to have NGINX reverse proxy to multiple MySQL servers listening on the same port using different names like you can with http? We don't want to perform any load balancing operation on them, we just want to be able to redirect to MySQL instances
based on a logical name, same as on http.</span></span></font></font></font></div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Helvetica, sans-serif; color: rgb(32, 31, 30); text-align: left; background-color: rgb(255, 255, 255)">
<font face="Helvetica Neue,arial,sans-serif"><font color="#002000"><font style="background-color: white"><span style="margin: 0px; font-size: 14px"><br>
</span></font></font></font></div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Helvetica, sans-serif; color: rgb(32, 31, 30); text-align: left; background-color: rgb(255, 255, 255)">
<font face="Helvetica Neue,arial,sans-serif"><font color="#002000"><font style="background-color: white"><span style="margin: 0px; font-family: "Helvetica Neue", arial, sans-serif; color: rgb(0, 32, 0); background-color: white"><b><u>Question 2</u></b></span></font></font></font></div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Helvetica, sans-serif; color: rgb(32, 31, 30); text-align: left; background-color: rgb(255, 255, 255)">
<font face="Helvetica Neue,arial,sans-serif"><font color="#002000"><font style="background-color: white"><span style="margin: 0px; font-family: "Helvetica Neue", arial, sans-serif; color: rgb(0, 32, 0); background-color: white">When I try to implement TLS encryption
between NGINX and MYSQL Database server, I have the following error on my MySQL Client : ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error</span></font></font></font></div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Helvetica, sans-serif; color: rgb(32, 31, 30); text-align: left; background-color: rgb(255, 255, 255)">
<font face="Helvetica Neue,arial,sans-serif"><font color="#002000"><font style="background-color: white"><span style="margin: 0px; font-size: 14px"><br>
</span></font></font></font></div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Helvetica, sans-serif; color: rgb(32, 31, 30); text-align: left; background-color: rgb(255, 255, 255)">
<font face="Helvetica Neue,arial,sans-serif"><font color="#002000"><font style="background-color: white"><span style="margin: 0px; font-family: "Helvetica Neue", arial, sans-serif; color: rgb(0, 32, 0); background-color: white">I have the following configuration
: Ubuntu server with the MySQL Client<span style="margin: 0px"> </span><b>//</b><span style="margin: 0px"> </span>NGINX (with the configuration below)<span style="margin: 0px"> </span><b>//</b><span style="margin: 0px"> </span>MYSQL Database (with SSL activated)</span></font></font></font></div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Helvetica, sans-serif; color: rgb(32, 31, 30); text-align: left; background-color: rgb(255, 255, 255)">
<font face="Helvetica Neue,arial,sans-serif"><font color="#002000"><font style="background-color: white"><span style="margin: 0px; font-size: 14px"><b>stream</b><span style="margin: 0px"><span style="margin: 0px"> </span>{<br>
</span>
<div style="margin: 0px"></div>
<div style="margin: 0px"> <span style="margin: 0px"> </span><b> upstream</b><span style="margin: 0px"> </span>mysql1 {</div>
<div style="margin: 0px"> <span style="margin: 0px"> </span><b>server<span style="margin: 0px"> </span></b>172.31.39.168:3306;</div>
<div style="margin: 0px"> }</div>
<div style="margin: 0px"></div>
<div style="margin: 0px"> <b><span style="margin: 0px"> </span>server</b><span style="margin: 0px"> </span>{</div>
<div style="margin: 0px"> <b><span style="margin: 0px"> </span>listen<span style="margin: 0px"> </span></b> 3306;</div>
<div style="margin: 0px"> <b><span style="margin: 0px"> </span>proxy_pass</b><span style="margin: 0px"> </span>mysql1;</div>
<div style="margin: 0px"> <span style="margin: 0px"> </span><b>proxy_ssl</b><span style="margin: 0px"> </span> on;</div>
<div style="margin: 0px"></div>
<div style="margin: 0px"> <b><span style="margin: 0px"> </span> proxy_ssl_certificate</b><span style="margin: 0px"> </span> /etc/ssl/client-cert.pem;</div>
<div style="margin: 0px"> <b><span style="margin: 0px"> </span> proxy_ssl_certificate_key</b><span style="margin: 0px"> </span> /etc/ssl/client-key.pem;</div>
<div style="margin: 0px"> <b><span style="margin: 0px"> </span> #proxy_ssl_protocols </b><span style="margin: 0px"> </span> TLSv1 TLSv1.1 TLSv1.2;</div>
<div style="margin: 0px"> <b><span style="margin: 0px"> </span> #proxy_ssl_ciphers </b><span style="margin: 0px"> </span> HIGH:!aNULL:!MD5;</div>
<div style="margin: 0px"> <span style="margin: 0px"> </span><b>proxy_ssl_trusted_certificate</b><span style="margin: 0px"> </span>/etc/ssl/ca-cert.pem;</div>
<div style="margin: 0px"></div>
<div style="margin: 0px"> <b>proxy_ssl_verify</b><span style="margin: 0px"> </span> on;</div>
<div style="margin: 0px"> <b>proxy_ssl_verify_depth</b><span style="margin: 0px"> </span> 2;</div>
<div style="margin: 0px"> <b>proxy_ssl_session_reuse</b><span style="margin: 0px"> </span>on;</div>
<div style="margin: 0px"> }</div>
<div style="margin: 0px">}</div>
<div style="margin: 0px"><span style="margin: 0px"></span><br>
</div>
<div style="margin: 0px"><span style="margin: 0px; font-size: 12pt; font-family: "Helvetica Neue", arial, sans-serif; color: rgb(0, 32, 0); background-color: white">If I comment proxy_ssl* parameters on NGINX, the connection works</span><span style="margin: 0px; font-size: 12pt; font-family: "Helvetica Neue", arial, sans-serif; color: rgb(0, 32, 0); background-color: white"><span style="margin: 0px"> </span>between
"</span><span style="margin: 0px; font-size: 12pt; font-family: "Helvetica Neue", arial, sans-serif; color: rgb(0, 32, 0); background-color: white">Ubuntu server (with the MySQL Client)" and "</span><span style="margin: 0px; font-size: 12pt; font-family: "Helvetica Neue", arial, sans-serif; background-color: white"><span style="margin: 0px; color: rgb(0, 32, 0); background-color: white">MYSQL
Database (with SSL activated)"</span></span><span style="margin: 0px; font-size: 12pt; font-family: "Helvetica Neue", arial, sans-serif; color: rgb(0, 32, 0); background-color: white"><span style="margin: 0px"> </span>throught "</span><span style="margin: 0px; font-size: 12pt; font-family: "Helvetica Neue", arial, sans-serif; color: rgb(0, 32, 0); background-color: white">NGINX".</span></div>
<div style="margin: 0px"><span style="margin: 0px; font-size: 12pt; font-family: "Helvetica Neue", arial, sans-serif; color: rgb(0, 32, 0); background-color: white"><br>
</span></div>
<div style="margin: 0px"><span style="margin: 0px; font-size: 12pt; font-family: "Helvetica Neue", arial, sans-serif; color: rgb(0, 32, 0); background-color: white">Thanks all</span></div>
</span></font></font></font></div>
<br>
<br>
</div>
</body>
</html>