分类 Nginx 下的文章

今天迁移了一个网站到新服务器,用 certbot 安装证书后访问报错 ERR_SSL_PROTOCOL_ERROR

看了下 nginx 的错误日志:

2024/04/16 19:17:14 [crit] 1286606#1286606: *8 SSL_do_handshake() failed (SSL: error:0A0000BA:SSL routines::bad cipher) while SSL handshaking, client: xxx.xxx.xxx.xxx, server: 0.0.0.0:443

奇怪的是,其他网站都是正常的。

检查配置,发现迁移网站的 nginx 配置跟其他网站的区别有一个:

ssl_prefer_server_ciphers off;

off 改为 on 后 service nginx reload,问题解决。

需要注意的是,由于 ssl 是 certbot 自动配置的,所以这个配置项在 /etc/letsencrypt/options-ssl-nginx.conf 这个文件里。

PS: 如果不在这个文件夹里,可以参见你的站点配置文件 include 了哪个配置文件。

- 阅读剩余部分 -

之前一直使用 acme.sh 手动搞,非常麻烦,而且现在又被墙了,更加麻烦。

使用 Certbot,分分钟搞定,并且后续也不需要任何操作,全部自动化了,省心省力。

我服务器使用的是 Ubuntu + Nginx,在 Certbot 官网上选择一下,就可以看到专用的教程了:

2024-03-05T18:43:44.png

根据教程,执行以下步骤:

Certbot 官网: https://certbot.eff.org/

- 阅读剩余部分 -

转自简书,原文已不可见。

vue-router 默认 hash 模式 —— 使用 URL 的 hash 来模拟一个完整的 URL,于是当 URL 改变时,页面不会重新加载。

如果不想要很丑的 hash,我们可以用路由的 history 模式,这种模式充分利用 history.pushState API 来完成 URL 跳转而无须重新加载页面。

- 阅读剩余部分 -

macOS 升级到 14.0 Sonoma 之后,发现 brew 安装的 nginx 无法启动了。

sudo brew services list 查看状态:

nginx error  256 root /Library/LaunchDaemons/homebrew.mxcl.nginx.plist

手动启动之:

$ sudo brew services start nginx 
Warning: Taking root:admin ownership of some nginx paths:
  /opt/homebrew/Cellar/nginx/1.25.2/bin
  /opt/homebrew/Cellar/nginx/1.25.2/bin/nginx
  /opt/homebrew/opt/nginx
  /opt/homebrew/opt/nginx/bin
  /opt/homebrew/var/homebrew/linked/nginx
This will require manual removal of these paths using `sudo rm` on
brew upgrade/reinstall/uninstall.
Warning: nginx must be run as non-root to start at user login!
Bootstrap failed: 5: Input/output error
Error: Failure while executing; `/bin/launchctl bootstrap system /Library/LaunchDaemons/homebrew.mxcl.nginx.plist` exited with 5.

- 阅读剩余部分 -