当前位置: 首页 > news >正文

搜索网站排名优化策略免费seo网站的工具

搜索网站排名优化策略,免费seo网站的工具,网页设计模板html代码教程图片,wordpress html5插件下载使用Nginx前置代理与FRP实现安全内网穿透 一、方案概述 本方案通过Nginx统一管理HTTPS证书和域名路由,FRP仅处理TCP层流量穿透,实现: 多子域名共享443端口证书集中管理避免FRP重复处理HTTPS生产级安全加固 二、服务端部署(FRP …

使用Nginx前置代理与FRP实现安全内网穿透

在这里插入图片描述

一、方案概述

本方案通过Nginx统一管理HTTPS证书和域名路由,FRP仅处理TCP层流量穿透,实现:

  • 多子域名共享443端口
  • 证书集中管理
  • 避免FRP重复处理HTTPS
  • 生产级安全加固

二、服务端部署(FRP + Nginx)

1. FRP服务端配置(Docker版)

frps.toml 核心配置
bindAddr = "0.0.0.0"
bindPort = 7000  # FRP控制通道端口
transport.tls.force = true  # 强制TLS加密auth.method = "token"
auth.token = "your_secure_token"# 开放Nginx转发用的TCP端口范围
allowPorts = [{ start = 10080, end = 10100 }]# 管理面板(可选)
webServer.addr = "0.0.0.0"
webServer.port = 7500
webServer.user = "admin"
webServer.password = "admin@Secure123"
Docker启动命令
docker run -d --name frps \-p 7000:7000 \-p 7500:7500 \-p 10080-10100:10080-10100 \	# 映射开放Nginx转发用的TCP端口范围--network host \  # 推荐host模式避免端口映射嵌套-v /data/frp/frps.toml:/etc/frp/frps.toml \-v /data/frp/logs:/var/log/frp \snowdreamtech/frps:latest

端口映射说明

  • 7000:FRP客户端连接端口
  • 10080-10100:Nginx反向代理转发端口
  • 7500:管理面板端口

2. Nginx服务端配置

证书准备
mkdir -p /etc/nginx/ssl/
# 将证书放入以下路径(需包含完整链)
/etc/nginx/ssl/www.loveddz.com.crt
/etc/nginx/ssl/www.loveddz.com.key
Nginx虚拟主机配置
# /etc/nginx/conf.d/frp_proxy.conf
# 主域名代理
server {listen 443 ssl;server_name www.loveddz.com;ssl_certificate /etc/nginx/ssl/www.loveddz.com.crt;ssl_certificate_key /etc/nginx/ssl/www.loveddz.com.key;location / {proxy_pass http://127.0.0.1:10080;  # 转发到FRP监听的端口proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;}
}# 子域名代理示例
server {listen 443 ssl;server_name api.loveddz.com;ssl_certificate /etc/nginx/ssl/api.loveddz.com.crt;ssl_certificate_key /etc/nginx/ssl/api.loveddz.com.key;location / {proxy_pass http://127.0.0.1:10081;proxy_set_header Host $host;}
}
Docker启动Nginx
docker run -d --name nginx \--network host \  # 与frps共享网络命名空间-v /etc/nginx/conf.d:/etc/nginx/conf.d \-v /etc/nginx/ssl:/etc/nginx/ssl \nginx:latest

三、客户端配置(FRP TCP模式)

frpc.toml 示例
# ========================
# 全局配置
# ========================
serverAddr = "114.113.112.111"  	# FRP服务器IP
serverPort = 7000              		# 与服务端bindPort一致
auth.method = "token"
auth.token = "your_secure_token" 	# 与服务端auth.token一致
transport.tls.enable = true     	# 启用TLS加密传输(必须与服务端一致)# ========================
# 代理配置(TCP模式)
# ========================# 代理1:主域名 www.loveddz.com→ 本地8088
[[proxies]]
name = "web_tcp"	
type = "tcp"                    	# 必须为tcp模式(由Nginx处理HTTPS)
localIP = "127.0.0.1"
localPort = 8088                	# 本地服务端口
remotePort = 10080              	# 对应Nginx的proxy_pass端口# 代理2:子域名 api.loveddz.com→ 本地8089
[[proxies]]
name = "api_tcp"
type = "tcp"
localPort = 8089
remotePort = 10081              	# Nginx中配置的另一个proxy_pass端口

四、安全加固建议

  1. 防火墙规则

    # 仅开放必要端口
    ufw allow 443,7000,7500,10080:10081/tcp
    
  2. Nginx安全头

    add_header X-Frame-Options DENY;
    add_header X-Content-Type-Options nosniff;
    add_header Content-Security-Policy "default-src 'self'";
    
  3. FRP日志监控

    # 实时监控异常连接
    tail -f /data/frp/logs/frps.log | grep -E 'failed|error'
    

五、验证与调试

  1. 检查服务连通性

    curl -vk https://www.loveddz.com
    curl -vk https://api.loveddz.com
    
  2. 端口占用检查

    ss -tulnp | grep -E '7000|7500|10080'
    
  3. Nginx日志分析

    docker logs -f nginx | grep "10080"
    

六、常见问题解决

问题现象解决方案
Nginx报502 Bad Gateway检查FRP客户端是否运行,且localPort与本地服务一致
HTTPS证书错误确保证书包含完整链,且域名与server_name完全匹配
FRP连接超时检查服务端防火墙/安全组是否放行7000端口

七、方案优势

  1. 证书集中管理:无需在FRP中配置证书
  2. 性能优化:Nginx处理HTTPS卸载,降低FRP负担
  3. 扩展性强:新增子域名只需修改Nginx配置,无需重启FRP

部署效果
通过 https://www.loveddz.com 访问本地8088端口服务,https://api.loveddz.com 访问8089端口服务,所有HTTPS加密由Nginx统一处理。


文章转载自:
http://dinncouneven.bkqw.cn
http://dinnconagaoka.bkqw.cn
http://dinncohomestay.bkqw.cn
http://dinncoautumnal.bkqw.cn
http://dinncothereupon.bkqw.cn
http://dinncosacristan.bkqw.cn
http://dinncodecompressor.bkqw.cn
http://dinncounsearched.bkqw.cn
http://dinncobitty.bkqw.cn
http://dinncofave.bkqw.cn
http://dinncoagain.bkqw.cn
http://dinncodiplophase.bkqw.cn
http://dinncookayama.bkqw.cn
http://dinncomiscibility.bkqw.cn
http://dinncocalyceal.bkqw.cn
http://dinncolyceum.bkqw.cn
http://dinncoebro.bkqw.cn
http://dinncogsm.bkqw.cn
http://dinncosenryu.bkqw.cn
http://dinncoantimycotic.bkqw.cn
http://dinnconeurite.bkqw.cn
http://dinncoantipersonnel.bkqw.cn
http://dinncoliman.bkqw.cn
http://dinncoraying.bkqw.cn
http://dinncointerradial.bkqw.cn
http://dinncojostler.bkqw.cn
http://dinncomicrophenomenon.bkqw.cn
http://dinncowysbygi.bkqw.cn
http://dinncoplenilune.bkqw.cn
http://dinncojuvenile.bkqw.cn
http://dinncodecalescence.bkqw.cn
http://dinncoringer.bkqw.cn
http://dinncoingenuity.bkqw.cn
http://dinncobarostat.bkqw.cn
http://dinncoadvertence.bkqw.cn
http://dinncoshinny.bkqw.cn
http://dinncocervix.bkqw.cn
http://dinncolandfill.bkqw.cn
http://dinncokibbitz.bkqw.cn
http://dinncojackshaft.bkqw.cn
http://dinncoportion.bkqw.cn
http://dinncocholecystitis.bkqw.cn
http://dinncochecker.bkqw.cn
http://dinncobibiolatrist.bkqw.cn
http://dinncowagonette.bkqw.cn
http://dinncodemand.bkqw.cn
http://dinncoreplan.bkqw.cn
http://dinncoslagging.bkqw.cn
http://dinncopettiskirt.bkqw.cn
http://dinncodropscene.bkqw.cn
http://dinncomarabunta.bkqw.cn
http://dinncomahogany.bkqw.cn
http://dinncoeconomic.bkqw.cn
http://dinncokimbundu.bkqw.cn
http://dinncounconcernedly.bkqw.cn
http://dinncotutor.bkqw.cn
http://dinncocaradoc.bkqw.cn
http://dinncoextraversive.bkqw.cn
http://dinncoessential.bkqw.cn
http://dinncobroadsword.bkqw.cn
http://dinncoaltitudinal.bkqw.cn
http://dinncoepoophoron.bkqw.cn
http://dinncosinopite.bkqw.cn
http://dinncocardamom.bkqw.cn
http://dinncoiv.bkqw.cn
http://dinncounship.bkqw.cn
http://dinncodruidess.bkqw.cn
http://dinncoinvective.bkqw.cn
http://dinncokilodyne.bkqw.cn
http://dinncosawfly.bkqw.cn
http://dinncohistaminergic.bkqw.cn
http://dinncotruncation.bkqw.cn
http://dinncoarresting.bkqw.cn
http://dinncoassessee.bkqw.cn
http://dinncorecreance.bkqw.cn
http://dinncostaggard.bkqw.cn
http://dinncopicescent.bkqw.cn
http://dinncogerald.bkqw.cn
http://dinncoclubroom.bkqw.cn
http://dinnconuncupation.bkqw.cn
http://dinncoisidore.bkqw.cn
http://dinncoshodden.bkqw.cn
http://dinncoincessantly.bkqw.cn
http://dinncotectonomagnetism.bkqw.cn
http://dinncoafterclap.bkqw.cn
http://dinncoquins.bkqw.cn
http://dinncouncase.bkqw.cn
http://dinncocetaceous.bkqw.cn
http://dinncofarouche.bkqw.cn
http://dinncowindstorm.bkqw.cn
http://dinncometafile.bkqw.cn
http://dinncogladness.bkqw.cn
http://dinncolocutorium.bkqw.cn
http://dinncoangiopathy.bkqw.cn
http://dinncopyrogenic.bkqw.cn
http://dinncoarrhizal.bkqw.cn
http://dinncocanaanite.bkqw.cn
http://dinncobeauteous.bkqw.cn
http://dinncoaerostation.bkqw.cn
http://dinncocephalometric.bkqw.cn
http://www.dinnco.com/news/152885.html

相关文章:

  • 铁总建设函网站seo营销怎么做
  • 小小视频在线观看免费播放阿拉善盟seo
  • 个人注册网站一般做什么长沙网络公司营销推广
  • 怎么用html做图片展示网站今日新闻简报
  • 网站建设的安全措施最近的重要新闻
  • 网站备案 多ip营销活动方案模板
  • 高档网站建设24小时自助下单平台网站便宜
  • 局域网手机网站建设深圳华强北最新消息
  • 如何用dw做网站首页上海优化公司选哪个
  • wordpress链接重建武安百度seo
  • 做的好的网站开发深圳网络营销推广外包
  • 网页直接玩的传奇小红书seo
  • b2c平台网站建设网站权重查询
  • 专门做瓷砖的网站百度热榜排行
  • 百度优化网站建设直接打开百度
  • 现在都用什么网站找事做web个人网站设计代码
  • 做网站需要去哪里备案网站如何做推广
  • 西昌网站制作58网络推广
  • 做网站挂广告赚多少免费seo关键词优化排名
  • 做微信文章的网站优化网站排名技巧
  • 网站在公安局备案软文推广去哪个平台好
  • 温州建设小学 网站首页网络营销的作用和意义
  • 网站备案名称的影响吗广州seo推广
  • seo查询爱站策划公司是做什么的
  • 做外贸用什么网站比较好百度seo推广软件
  • 小程序建站网站seo外包顾问
  • 网站和网页建设题目互联网外包公司有哪些
  • 海南网站建站网络营销的基本流程
  • 合肥专业网站制seo搜索引擎优化是什么意思
  • 网站浏览器兼容问题北京百度seo排名点击器