当前位置:首页 » 《关于电脑》 » 正文

NPS配置https访问web管理页面

9 人参与  2024年04月19日 11:49  分类 : 《关于电脑》  评论

点击全文阅读


因为NPS默认也支持http的访问,所以在部署完后就一直没在意这个事情。
因为服务器是暴露在公网内的,所以还是要安全一点才行。不然一旦远控的机器被破解了就很危险了

一、使用nginx反向代理访问

1、首先在nps的配置文件里关闭使用https选项,同时修改端口为只允许本机连接

配置文件位于 /etc/nps/conf/nps.conf

#HTTP(S) proxy port, no startup if emptyhttp_proxy_ip=127.0.0.1  #注意修改http_proxy_port=34565https_proxy_port=34566https_just_proxy=false#default https certificate setting#https_default_cert_file=conf/qingtongqing.cc_bundle.pem#https_default_key_file=conf/qingtongqing.cc.key#webweb_host=a.o.comweb_username=adminweb_password=xxxxxxweb_port = 34567web_ip=127.0.0.1   #注意修改web_base_url=web_open_ssl=falseweb_cert_file=conf/qingtongqing.cc_bundle.pemweb_key_file=conf/qingtongqing.cc.key

2、在nginx的配置文件下添加有关nps的配置文件,不建议直接修改nginx配置
在路径/etc/nginx/conf.d 下添加 nps.conf 配置文件

server {    listen 3456 ssl;    server_name www.qingtongqing.cc;  # 替换成你的NPS域名    ssl_protocols TLSv1.2;  # 使用与NPS相同的SSL/TLS版本    ssl_ciphers 'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384';    ssl_certificate /ssl/qingtongqing.cc_nginx/qingtongqing.cc_bundle.crt;  # 替换成你的SSL证书文件路径    ssl_certificate_key /ssl/qingtongqing.cc_nginx/qingtongqing.cc.key;  # 替换成>你的SSL私钥文件路径    location / {        proxy_pass https://127.0.0.1:34567;  # 替换成你NPS服务的实际IP地址和端口号        proxy_set_header Host $host;        proxy_set_header X-Real-IP $remote_addr;        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;        proxy_set_header X-Forwarded-Proto $scheme;    }}

配置文件做完后要等待一段时间,记得重启nps客户端和nginx程序

二、直接配置文件修改使用https

nps的配置文件里打开使用https选项,同时修改端口为允许所有客户端连接
配置文件位于 /etc/nps/conf/nps.conf

#HTTP(S) proxy port, no startup if emptyhttp_proxy_ip=0.0.0.0http_proxy_port=34565https_proxy_port=34566https_just_proxy=false#default https certificate setting#https_default_cert_file=conf/qingtongqing.cc_bundle.pem#https_default_key_file=conf/qingtongqing.cc.key#webweb_host=a.o.comweb_username=adminweb_password=xxxxxxweb_port = 34567web_ip=0.0.0.0web_base_url=web_open_ssl=trueweb_cert_file=/ssl/qingtongqing.cc_nginx/qingtongqing.cc_bundle.crt  #注意修改文件路径web_key_file=/ssl/qingtongqing.cc_nginx/qingtongqing.cc.key   #注意修改文件路径

三、重启验证

在这里插入图片描述

在这里还是推荐使用nginx反向代理的方法去做,NPS毕竟是非商业化的开源软件,开放端口暴露在公网上有一定的风险存在。


点击全文阅读


本文链接:http://zhangshiyu.com/post/97513.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

关于我们 | 我要投稿 | 免责申明

Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1