通过Nginx反向代理连接到MySQL Server

时间:2019-10-12 02:37:29

标签: mysql nginx reverse-proxy

所以我正在尝试Nginx,我想将Nginx用作我的MySQL实例的反向代理,例如

客户端连接到mysql.jeremyruffell.dev,然后将其反向代理到我的服务器。

(Cleint)-> mysql.jeremyruffell.dev->服务器:3306(MySQL实例)

我尝试过这个conf,但是没有运气。

server {
    listen 443 ssl;
    listen [::]:443 ssl;
    include snippets/self-signed.conf;
    include snippets/ssl-params.conf;
    server_name sql.jeremyruffell.tk;
    location / {
        proxy_pass https://localhost:3306;
    }
    ssl_certificate /etc/letsencrypt/live/jeremyruffell.tk-0002/fullchain.pem;
# managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/jeremyruffell.tk-0002/privkey.pem;
}

任何帮助将不胜感激! 谢谢,

0 个答案:

没有答案