Fourteenth-Day Adventist

  • 首页
  • 随笔
  • 隐私政策
  • RNGesus
  • 摄影画廊
ובחדש הראשון בארבעה עשר יום לחדש פסח ליהוה
ἐάν τι αἰτήσητέ με ἐν τῷ ὀνόματί μου ἐγὼ ποιήσω
  1. 首页
  2. Linux
  3. 正文

多网站同一服务器别用Certbot Redirect

2022/12/09 0人点赞 0条评论

本来想搞一个英文的网站,和这个网站放在一个主机上,设置完了连得上,最后一步去装SSL的时候用Certbot,安装的时候选了2,redirect HTTP to HTTPS,然后网站就完全打不开了,过多重定向错误。。。。。。。。。。。。。。

想了下应该是Certbot Redirect造成的,就去/etc/nginx/sites-enabled/ 里面把Certbot加的设置都删除了,结果还是不行。。。。。。。。打开网页会神奇的跳到这个站点,但是我完全没设置转发到这个站点,root目录也没设置错,百思不得其解,还以为是Cloudflare DNS的问题

最后发现是Certbot把我nginx设置里面server的listen 80; 给删了。。。。。。。。。。。。。。。。。。。导致浏览器打开网页默认80端口只有我这个网站在监听就跳这里了

解决方案是把listen 80; 加回去然后重启下nginx就可以了

顺带一下Certbot不用Snapd的安装和使用,官网https://certbot.eff.org/instructions?ws=nginx&os=ubuntufocal 很神奇的只给Snapd安装方法了。。。

sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d example.com -d www.example.com #用nginx
sudo systemctl status certbot.timer #查看自动更新证书是否启动

标签: bug Linux 服务器
最后更新:2023/04/07

Fourteenth-Day Adventist

Two more weeks, trust the plan!

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

Fourteenth-Day Adventist

Two more weeks, trust the plan!

标签聚合
Dugin 服务器 Duginism Global South Linux 随笔 bug 编程

COPYRIGHT © 2022 Fourteenth-Day Adventist. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang