
NPS是一款轻量级、高性能、功能强大的内网穿透代理服务器,几乎支持所有协议,支持内网http代理、内网socks5代理、p2p等,简洁但功能强大的WEB管理界面,支持服务端、客户端同时控制,扩展功能强大,全平台兼容.
但是NGINX已经占用了443端口,以下方法可以让NPS和NGINX都能用到443端口.
- 每次修改完nginx.conf和npss.conf文件都要重启nginx,命令:systemctl restart nginx
- 每次修改完nps.conf文件都要重启nps,命令:nps restart
1. 安装NPS
#创建nps工作目录并进入
mkdir /home/nps
cd /home/nps
#下载服务端程序
wget https://github.com/ehang-io/nps/releases/download/v0.26.10/linux_amd64_server.tar.gz
#解压
tar -xf linux_amd64_server.tar.gz
#安装
./nps install
2. 配置nps.conf文件
**
**
#HTTP(S) proxy port, no startup if empty
http_proxy_ip=0.0.0.0
http_proxy_port=7780 /*为了不和nginx的80端口冲突,此处修改为7780端口*/
#https_proxy_port=7443
#https_just_proxy=true
#default https certificate setting
#https_default_cert_file=conf/server.pem
#https_default_key_file=conf/server.key
**
**
# if web under proxy use sub path. like http://host/nps need this.
web_base_url=/nps /*配合nginx的location*/
**
**
3. nginx配置文件
server {
listen 443 ssl;
server_name aa.bb.com;
ssl_certificate /home/cert/**.pem;
ssl_certificate_key /home/cert/**.key;
**
**
location /nps {
proxy_redirect off;
proxy_pass http://127.0.0.1:8080; /*访问http://ip/nps,会跳转到127.0.0.1:8080(web界面)*/
proxy_http_version 1.1;
proxy_set_header Host $host;
}
**
**
include /etc/nps/conf/npss.conf; /*另外添加一个nps的配置*/
}
4. 至此,nps的web界面已经可以打开,打开网址为第三步的https://aa.bb.com/nps,在web界面新建客户端.
备注:可留空
认证用户名:可留空
认证密码:可留空
验证密钥: 系统随机
允许***,压缩,加密:是
生成客户端后,点击客户端前面的+号,有客户端命令,在内网的客户端用此命令启动nps_client.稍等一会,客户端界面会显示此客户端已经在线.至此,客户端和服务器端连接成功.
5. 访问内网的web服务器.
①.修改npss.conf配置文件
server {
listen 80;
server_name openwrt.bb.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name openwrt.bb.com;
ssl_certificate /home/cert/**.pem;
ssl_certificate_key /home/cert/**.key;
location / {
proxy_pass http://127.0.0.1:7780; /*nginx的流量转到7780端口(nps的代理端口)
proxy_redirect http://$host/ http://$http_host/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
}
②.在NPS的web界面添加域名解析.
新增域名解析:
客户端ID:第四部创建客户端后,系统会分配一个ID
主机:openwrt.bb.com /*和第五步的①中的server_name对应*/
模式:http
目标:IP:端口 /*内网web服务器的IP及访问端口*/
6. 现在可用https://openwrt.bb.com访问内网web服务器.
网络流程图:

文章评论
<a href=https://propecia2buy.top/>propecia results</a> J Am Coll Cardiol Img 6 1141 1151
I like this weblog very much, Its a real nice position to read and receive info .
Hi my loved one! I wish to say that this post is awesome, great written and come with almost all important infos. I¦d like to look extra posts like this .
There's noticeably a bundle to know about this. I assume you made sure nice factors in options also.
Saved as a favorite, I really like your blog!
Good shout<a href="https://www.morningstar.com/news/globe-newswire/9489727/area-52-named-1-best-thc-gummies-by-oregon-observer">.</a>
Nice
thca gummies area 52
<a href="https://www.morningstar.com/news/globe-newswire/9493483/disposable-weed-pen-premium-award-winning-all-in-one-thc-vaporizers-launched-by-area-52>Area 52 has the best disposable weed pen according to Morningstar consumer reviews</a>
<a href="https://xx.area52.me/go/cbd1.php>Anxiety</a>
where to buy thca area 52
best sativa thc carts area 52
full spectrum cbd gummies area 52
thc gummies
thc gummies for sleep area 52
best sativa thc edibles area 52
distillate carts area 52
buy pre rolls online area 52
infused pre rolls area 52
thca diamonds area 52
live rosin gummies area 52
live resin gummies area 52
best indica thc weed pens area 52
thc gummies for anxiety area 52
thc oil area 52
thc tincture area 52
disposable weed pen area 52
thc pen area 52
thca flower area 52
live resin area 52
thc microdose gummies area 52
mood gummies area 52
thca vape area 52
liquid diamonds area 52
thc vape hybrid area 52
liquid thc area 52
legal mushroom gummies area 52
snow caps thca area 52
thc gummies for pain area 52
live resin carts area 52
thcv gummies area 52
hybrid gummies area 52
indica gummies area 52
<a href="https://irb.harvard.edu/Shibboleth.sso/Logout?return=https://royalcbd.com/cbd-gummies/>CBD Gummies 2025: Best CBD Gummies for Pain Anxiety & Sleep</a>
Hello there from DreamProxies.com
Amazing news: top quality, fast speed and reliable private proxies now even cheaper:
50% OFF - For All Private Proxies!
View proxy offers and sales:
http://tiny.cc/DreamProxies-Discounts
Key features and advantages that come with all proxies plan on DreamProxies:
+ Complete Anonymity - fully private and anonymous quality proxy servers
+ Ultimate Quality - highest superior quality and reliability with each proxy package
+ Blazing Speed - up to 1,000 mb/s per proxy - fastest speed servers
+ Unlimited Data - no usage limits and absolute freedom using proxies
+ Reliable Servers - fully-powered stable datacenter proxy servers
+ Low Prices - among the cheapest proxy services you can find on the market
+ Extra Discounts - exclusive promo codes and sales for proxies on website
50% SALE for all proxies plans - by DreamProxies.com
Nice post. I learn one thing tougher on completely different blogs everyday. It will at all times be stimulating to learn content material from different writers and practice a bit of one thing from their store. I’d favor to use some with the content material on my blog whether you don’t mind. Natually I’ll provide you with a hyperlink on your web blog. Thanks for sharing.
Hey there! I've been reading your blog for some time now and finally got
the courage to go ahead and give yoou a shout out from Kingwood Tx!
Just wanted to tell you keep up the good work!
Can I just say what a relief to find someone who actually knows what theyre talking about on the internet. You definitely know how to bring an issue to light and make it important. More people need to read this and understand this side of the story. I cant believe youre not more popular because you definitely have the gift.
I am no longer certain where you are getting your info, however good topic. I must spend a while studying more or figuring out more. Thanks for excellent information I used to be in search of this information for my mission.
Hi, I think your website might be having browser compatibility issues. When I look at your website in Safari, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, fantastic blog!
Nice read, I just passed this onto a friend who was doing a little research on that. And he just bought me lunch since I found it for him smile So let me rephrase that: Thanks for lunch!
I am impressed with this website , real I am a big fan .
But wanna remark that you have a very nice internet site, I like the design it really stands out.
Google Analytics Alternative