4

问下家用服务器部署博客域名怎么隐藏端口号

 1 year ago
source link: https://www.v2ex.com/t/939112
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  问与答

问下家用服务器部署博客域名怎么隐藏端口号

  StoneHuLu · 15 小时 13 分钟前 · 2065 次点击
目前家里服务器是两台淘汰电脑组的 pve 集群

域名是泛解析 cname 到 ddns 域名,ddns 域名解析到家宽动态公网 ip ,家宽 80 和 443 端口都被运营商 ban 了
路由器解析 30443 和 30080 两个端口到家里 elb 负载均衡( k3s 内),ingress 是 traefik ,service 用的 LoadBalance 的 type ,traefik 走 Route 规则根据二级域名反向代理到具体的容器内

泛解析域名:*.public.xxxx.cn
ddns 域名:ddns.xxxx.cn
博客域名地址:blog.public.xxxx.cn:30443

之前是 k8s 部署在云服务器上,但是用下来 5 年要好几千块钱,就迁移到本地了,之前尝试过 dns 解析使用隐性 url ,但是本质就是域名解析到供养商那边的一个 iframe 页面,博客实际上在 iframe 里面,确实能隐藏掉端口号,但是影响 seo ,
想问下有更好的办法吗,难道说一定要嫖个带公网 ip 的云服务器才行了?

第 1 条附言  ·  14 小时 28 分钟前

我隐藏端口号不是为了自己看着爽,主要是为了 seo
以前在云服务器的时候我博客是在各大搜索引擎上都能搜到的
现在有端口号相当于我之前的 seo 都白做了。。
写博客是为了自己的经验能分享给跟我遇到了同样偏门问题的同好能少走点弯路
如果别人看不到我分享的经验,那博客不就只是自嗨了吗

第 2 条附言  ·  11 小时 40 分钟前

已经找到最优解了,就是用 Cloudflare Tunnel 代理一下
Cloudflare Tunnel 创建完后会给一个{uuid}.cloudflare.org 之类的域名
然后回到自己的域名那边 CNAME 一个域名到 cloudflare 的域名就可以了
个人使用基本毫无限制且免费,应该完全支持 seo ,外部访问不用带特殊端口号了
感谢大家

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK