目 录CONTENT

文章目录

nginx反向代理windows远程桌面(DB等)

BKUN
2023-06-19 / 0 评论 / 0 点赞 / 364 阅读 / 125 字

解决问题:内网windows需要开放到互联网访问,通过nginx 反向代理实现互联网mstsc

nginx配置如下

stream {
  upstream mstsc{
  	server 192.168.1.2:3389;
  }
  server {
    listen 43389;
    proxy_pass mstsc;
  }
}

关闭selinux

方法一:临时关闭

setsebool -P httpd_can_network_connect 1

方法二:永久关闭

[root@localhost nginx]# getenforce
Permissive
[root@localhost nginx]# setenforce 1
[root@localhost nginx]# getenforce
Enforcing
[root@localhost nginx]# setenforce 0
[root@localhost nginx]# getenforce
Permissive
[root@localhost nginx]# sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config

外网访问 公网IP:433389

0

评论区