当前位置:   article > 正文

nginx反向代理emqx配置https_emqx 8083 nginx1.23

emqx 8083 nginx1.23

步骤1:首先安装并启用emqx服务器,此步骤可参照官网文档操作,官网文档

步骤2:配置nginx

  1. ......
  2. upstream mqtt_websocket_servers {
  3. server 192.168.0.2:8083;
  4. }
  5. server {
  6. listen 8800 ssl;
  7. server_name baidu.com;
  8. ssl_certificate cert/baidu.com.cer;
  9. ssl_certificate_key cert/baidu.com.key;
  10. ssl_session_cache shared:SSL:1m;
  11. ssl_session_timeout 5m;
  12. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  13. ssl_protocols TLSv1.2 TLSv1.3;
  14. ssl_prefer_server_ciphers on;
  15. location / {
  16. root html;
  17. index index.html index.htm;
  18. }
  19. location /mqtt {
  20. proxy_pass http://mqtt_websocket_servers;
  21. proxy_http_version 1.1;
  22. proxy_set_header Upgrade $http_upgrade;
  23. proxy_set_header Connection "Upgrade";
  24. # 反向代理真实 IP
  25. proxy_set_header Host $host;
  26. proxy_set_header X-Real-IP $remote_addr;
  27. proxy_set_header REMOTE-HOST $remote_addr;
  28. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  29. # 禁用缓存
  30. proxy_buffering off;
  31. }
  32. }
  33. ......

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号